-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
JoinHandle::abort() panics with "scheduler context missing" when using basic scheduler #3662
Comments
No, this isn't intentional. Does it also fail if called from |
Yes, that crashes as well: use std::time::Duration;
#[tokio::main(flavor = "current_thread")]
async fn main() {
let j = tokio::spawn(tokio::time::sleep(Duration::from_secs(3)));
let t = std::thread::spawn(move || {
std::thread::sleep(Duration::from_secs(1));
j.abort();
});
tokio::time::sleep(Duration::from_secs(2)).await;
assert!(t.join().is_err());
} |
Hey, would you be able to check if #3672 fixes your issue? |
@carllerche @udoprog Yes, it looks like it's fixed now. Thanks y'all! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
tokio v1.4.0
tokio-macros v1.1.0 (proc-macro)
Platform
Linux mtgav 5.10.4-arch2-1 #1 SMP PREEMPT Fri, 01 Jan 2021 05:29:53 +0000 x86_64 GNU/Linux
Description
When using the basic scheduler/current_thread, JoinHandle::abort() panics if called from a
spawn_blocking
thread. Same bug as #3157 but with the basic scheduler orflavor = "current_thread"
. It can be worked around by doing the abort within a tokio::spawn(), but if this limitation is intentional it should be added the documentation.Code snippet:
Resulting panic:
The text was updated successfully, but these errors were encountered: