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

runtime: swallow panics in drop(join_handle) #4430

Merged
merged 3 commits into from Jan 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions tokio/src/runtime/task/harness.rs
Expand Up @@ -173,6 +173,10 @@ where
// the scheduler or `JoinHandle`. i.e. if the output remains in the
// task structure until the task is deallocated, it may be dropped
// by a Waker on any arbitrary thread.
//
// Panics are delivered to the user via the `JoinHandle`. Given that
// they are dropping it, we assume they are not interested in it,
// and swallow it.
BraulioVM marked this conversation as resolved.
Show resolved Hide resolved
let _ = panic::catch_unwind(panic::AssertUnwindSafe(|| {
Darksonn marked this conversation as resolved.
Show resolved Hide resolved
self.core().stage.drop_future_or_output();
}));
Expand Down