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?
No response
What is the issue?
Self wakes are not being detected by tokio console.
How can the bug be reproduced?
The burn task in the app example should result in self wakes, because it calls tokio::task::yield_now() from within the task.
#[tracing::instrument]asyncfnburn(min:u64,max:u64){loop{for i in min..max {for _ in0..i {
tokio::task::yield_now().await;}
tokio::time::sleep(Duration::from_secs(i - min)).await;}}}
Looking at the logic of yield_now(), it seems that it may not actually result in a self wake (wake being called from within the span of the task being woken). So to check, I replaced the call to yield_now() with a call to a simple_yield_now() which should always wake within the span of the task:
Unfortunately, the task.id field in runtime.spawn span refers to the Tokio Task ID of the task, whereas the task.id in the waker event is the Span ID of the runtime.spawn span. So it's not immediately clear why
Versions
tokio-console v0.1.8
console-subscriber v0.1.9
It's also occuring on main at the time of writing cbf6f5.
Possible solution
No response
Additional context
No response
Would you like to work on fixing this bug?
yes
The text was updated successfully, but these errors were encountered:
What crate(s) in this repo are involved in the problem?
No response
What is the issue?
Self wakes are not being detected by tokio console.
How can the bug be reproduced?
The
burn
task in theapp
example should result in self wakes, because it callstokio::task::yield_now()
from within the task.Looking at the logic of
yield_now()
, it seems that it may not actually result in a self wake (wake being called from within the span of the task being woken). So to check, I replaced the call toyield_now()
with a call to asimple_yield_now()
which should always wake within the span of the task:However, tokio-console still fails to report a self wake.
Logs, error output, etc
We the following in the traces:
Unfortunately, the
task.id
field inruntime.spawn
span refers to the Tokio Task ID of the task, whereas thetask.id
in thewaker
event is the Span ID of theruntime.spawn
span. So it's not immediately clear whyVersions
tokio-console
v0.1.8console-subscriber
v0.1.9It's also occuring on
main
at the time of writing cbf6f5.Possible solution
No response
Additional context
No response
Would you like to work on fixing this bug?
yes
The text was updated successfully, but these errors were encountered: