You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What crate(s) in this repo are involved in the problem?
tokio-console, console-subscriber
What is the issue?
I see there have been false positives in the past, but since #149 is resolved, I'll file a fresh issue for this specific case.
I'm seeing tokio-console reporting that tasks have lost their waker, when in fact the task has finished.
This seems to happen if the task in question spawned another task, but then dropped the join handle for the subtask. The parent task then only shows as complete once the subtask finishes.
How can the bug be reproduced?
The following code is able to reproduce the problem. The warning shows for 10 seconds, then goes away for the next 10 seconds before the program terminates.
use anyhow::Result;use futures_channel::oneshot;use std::time::Duration;#[tokio::main(flavor = "current_thread")]asyncfnmain() -> Result<()>{
console_subscriber::init();let(send, recv) = oneshot::channel::<()>();constDELAY:Duration = Duration::from_secs(10);
tokio::task::spawn(asyncmove{
tokio::time::sleep(DELAY).await;drop(send);});// The following task (outer task) finishes almost instantly (the println// below is reached). However tokio-console says that it has lost its waker// and will never be woken. Only once the inner task finishes is the outer// task marked as terminated.
tokio::task::spawn(asyncmove{
tokio::task::spawn(asyncmove{let _ = recv.await;});}).await.unwrap();println!("Waiting to finish");
tokio::time::sleep(DELAY*2).await;Ok(())}
[package]
name = "t1"version = "0.1.0"edition = "2021"
[dependencies]
tokio = { version = "1.20.1" }
console-subscriber = "0.1.8"anyhow = "1.0.65"futures-channel = "0.3.24"
What crate(s) in this repo are involved in the problem?
tokio-console, console-subscriber
What is the issue?
I see there have been false positives in the past, but since #149 is resolved, I'll file a fresh issue for this specific case.
I'm seeing tokio-console reporting that tasks have lost their waker, when in fact the task has finished.
This seems to happen if the task in question spawned another task, but then dropped the join handle for the subtask. The parent task then only shows as complete once the subtask finishes.
How can the bug be reproduced?
The following code is able to reproduce the problem. The warning shows for 10 seconds, then goes away for the next 10 seconds before the program terminates.
Logs, error output, etc
No response
Versions
Possible solution
No response
Additional context
No response
Would you like to work on fixing this bug?
maybe
The text was updated successfully, but these errors were encountered: