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

tokio::task::spawn_blocking() tasks show as 'warning: task has never yielded' #528

Closed
capveg-netdebug opened this issue Feb 20, 2024 · 2 comments
Labels
S-bug Severity: bug

Comments

@capveg-netdebug
Copy link

What crate(s) in this repo are involved in the problem?

tokio-console

What is the issue?

I think this is just a display issue, but IMHO an (intentionally) blocking task, e.g., from spawn_blocking shouldn't show up as a warning.

How can the bug be reproduced?

use std::time::Duration;

#[tokio::main]
async fn main() {
    console_subscriber::init();
    tokio::task::spawn_blocking( move || {
        loop { std::thread::sleep(Duration::from_secs(10))}
    });
}

See screenshot
Screenshot from 2024-02-20 11-01-26

Logs, error output, etc

No response

Versions

[robs@LAPTOP-O7RS71IJ tokio-console-repro]$ cargo tree | grep console
tokio-console-repro v0.1.0 (/home/robs/git/tokio-console-repro)
├── console-subscriber v0.2.0
│   ├── console-api v0.6.0

Possible solution

Test if the task is a task_blocking before warning.

Additional context

Great project - thank you for it!

Would you like to work on fixing this bug?

yes

@capveg-netdebug capveg-netdebug added the S-bug Severity: bug label Feb 20, 2024
@hds
Copy link
Collaborator

hds commented Feb 20, 2024

Thanks for your issue submission. It's lovely and clear.

This is a duplicate of #516, and even better it has been fixed in the PR #517.

That hasn't gone out for a release yet, but we're hoping to get a new release out before too long.

I'll close this as a duplicate. Please comment if you think we've missed something.

@hds hds closed this as completed Feb 20, 2024
@capveg-netdebug
Copy link
Author

Thank you for the fast reply! FYI: I did see #516 but it wasn't clearly the same thing so I filed anyway (and forgot to reference #516). Looking forward to the fix being released and thank you again for the great tool!

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

No branches or pull requests

2 participants