-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
blocking
and block_on
tasks have false positive lints
#516
Labels
A-warnings
Area: warnings
C-console
Crate: console.
E-easy
Effort: easy. Good for newcomers
S-bug
Severity: bug
Comments
hds
added
S-bug
Severity: bug
E-easy
Effort: easy. Good for newcomers
C-console
Crate: console.
A-warnings
Area: warnings
labels
Feb 7, 2024
Hi! I'd like to work on this. It looks like a great issue to get started in tokio-console contributions, which is exactly my idea. |
javihernant
added a commit
to javihernant/console
that referenced
this issue
Feb 7, 2024
change existing lints to only trigger with tasks that are async; those are all except those with kind 'blocking' and 'block_on' this commit fixes issue tokio-rs#516
javihernant
added a commit
to javihernant/console
that referenced
this issue
Feb 7, 2024
change existing lints to only trigger with tasks that are async; those are all except those with kind 'blocking' and 'block_on' this commit fixes issue tokio-rs#516
javihernant
added a commit
to javihernant/console
that referenced
this issue
Feb 7, 2024
change existing lints to only trigger with tasks that are async; those are all except those with kind 'blocking' and 'block_on' this commit fixes issue tokio-rs#516
javihernant
added a commit
to javihernant/console
that referenced
this issue
Feb 8, 2024
change existing lints to only trigger with tasks that are async; those are all except those with kind 'blocking' and 'block_on' this commit fixes issue tokio-rs#516
javihernant
added a commit
to javihernant/console
that referenced
this issue
Feb 8, 2024
change existing lints to only trigger with tasks that are async; those are all except those with kind 'blocking' and 'block_on' this commit fixes issue tokio-rs#516
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-warnings
Area: warnings
C-console
Crate: console.
E-easy
Effort: easy. Good for newcomers
S-bug
Severity: bug
What crate(s) in this repo are involved in the problem?
tokio-console
What is the issue?
When using the
#[tokio::main]
macro, some non-async tasks are missed because theconsole-subscriber
is initialized after the runtime has already started. Specificallyblock_on
taskblocking
tasks for the workers in a multi-thread runtimeThis hides a problem which is only visible if the
console-susbcriber
is started before the runtime. Both these types of tasks trigger false-positive warnings from lints.block_on
triggers the lost waker lintblocking
tasks trigger the never yielded lintHow can the bug be reproduced?
The following code reproduces both false positives:
Logs, error output, etc
The view in Tokio Console is:
Versions
tokio-console
0.1.10 (also onmain
at the time of reporting)Possible solution
kind
(added in feat(console): replace target column with kind column in tasks view #478) of the task being checked.Only if the
kind
istask
orlocal
should the actual check be performed, if thekind
isblock_on
orblocking
thenWarning::Ok
should be returned.For the current 3 lints that have been written,
block_on
andblocking
tasks should always returnWarning::Ok
as the lints only make sense for true async tasks that are polled.The text was updated successfully, but these errors were encountered: