Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push error into the init_done channel for debugging context #238

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

haixuanTao
Copy link
Collaborator

After adding #236 , error of initialization is shadowed by bailing on the sender channel.

Cause

The reported error used to be this one:

.wrap_err("the `init_done` channel was closed unexpectedly")?;

as the runtime would fail on initialisation and would close the init_done channel before using it.

This makes it hard to debug.

Solution

This PR will push the error into the sender channel, and report any error of initialization making it easier to debug.

Now the channel is used without error, but any error of initialization will bail the runtime here:

.wrap_err("failed to init an operator")?;

After adding #236 , error of initialization is shadowed by bailing on
the sender channel.

Bailing used to happen here: https://github.com/dora-rs/dora/blob/ccec196234c46fc5df7a0f7c7cd15d29a2bda670/binaries/runtime/src/lib.rs#L136

This makes it hard to debug.

This PR will push the error into the sender channel, and report any error
of initialization making it easier to debug.

Now the channel is used without error, but any error of initialization
will bail the runtime here: https://github.com/dora-rs/dora/blob/ccec196234c46fc5df7a0f7c7cd15d29a2bda670/binaries/runtime/src/lib.rs#L137
Copy link
Collaborator

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants