-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Report when a task doesn't / hasn't yielded in a while. #203
Comments
This should be pretty easy. I think the only difficult part is that we'll have to determine how long a task should have run before yielding before adding a warning. |
@tobz if you're interested in working on this, the way we'd do it is adding a new type implementing the console/console/src/warnings.rs Lines 4 to 47 in 7d16ead
This would be pretty similar to existing warnings, like console/console/src/warnings.rs Lines 118 to 135 in 7d16ead
I think that in the check method for this, we'd want to flag a task for the warning if all of the following are true:
|
we probably want to be fairly generous with the threshold, to avoid false positives...it could be something like 5-10 ms? I don't think we want the lint to fire on particularly short-lived tasks; if a task only has two or three await points in it, it's entirely possible that one instance of that task might just be lucky enough that they're all ready, and that's fine if it runs for like, 1ms or less! |
@tobz still planning on working on this? |
As interesting as it may be, I think my spare time is a bit too small at
the moment to take this. :(
…On Wed, Jan 12, 2022, 2:04 PM Eliza Weisman ***@***.***> wrote:
@tobz <https://github.com/tobz> still planning on working on this?
—
Reply to this email directly, view it on GitHub
<#203 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABWLF6BTMA4HXXECUSPLWDUVXGFDANCNFSM5KERGL6Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi there, |
@fbrv sorry i didn't reply sooner --- are you still interested in working on this issue? If so, please feel free to open a PR, or let me know if you have any questions! |
Hi @hawkw, I'm considering working on this if I can, but have a question, my assumptions may be wrong so forgive me if that's the case.
Does checking if a task is running and for longer than the threshold check all 3? My assumptions being:
|
Hi! I saw that this went a little stale so I opened up a PR, happy to take feedback on it! Thanks |
Since #439 got merged, should this issue be closed? |
Yes. I think we can close it now. Thank you! |
While using
tokio-console
for debugging some weird behavior -- by the way,tokio-console
has been great so far! -- I ended up discovering that my original issue was related to a task that never yielded. Whiletokio-console
helped me figure this out by displaying that a companion task hadn't yet been woken up (because of the other task not yielding), it would have saved me a step or two if instead I was able to see that the non-yielding task hadn't yielded in a while/at all.Not sure if this is simple to surface or not, but figured I'd file an issue for it regardless. :)
The text was updated successfully, but these errors were encountered: