Description
What crate(s) in this repo are involved in the problem?
tokio-console, console-subscriber
What is the issue?
occasionally when running my application under tokio-console, i have been noticing that some tasks are always shown as being busy, when i don't believe that this is actually true
How can the bug be reproduced?
use futures_util::StreamExt as _;
#[tokio::main]
async fn main() {
console_subscriber::init();
tokio::spawn(async {
tokio::task::spawn_blocking(move || loop {
std::thread::sleep(std::time::Duration::from_secs(15));
});
let mut stream: futures_util::stream::SelectAll<_> =
[futures_util::stream::once(std::future::pending::<()>())]
.into_iter()
.collect();
while let Some(_res) = stream.next().await {
unimplemented!()
}
})
.await
.unwrap();
}
i can't seem to minimize this any further, although i would be surprised if all of this was actually necessary to trigger this problem. removing the spawn_blocking
call makes it stop happening, as does replacing the SelectAll
with just the bare once
stream. even with this example as it is, it only seems to trigger once every two or three runs.
Logs, error output, etc
console output when running the above example:
Versions
console-subscriber v0.1.3 (https://github.com/tokio-rs/console#be8bd8fc)
console-api v0.1.2 (https://github.com/tokio-rs/console#be8bd8fc)
tokio-console be8bd8fc741378f4ea8e84cc056614b47f174217
Possible solution
No response
Additional context
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=55e0c13c73383b434848068e001254aa seems to indicate that the task should not actually be blocked, which points more toward some kind of instrumentation issue
Would you like to work on fixing this bug?
no