console: warnings: False positives with `LostWaker` warning

Currently, the LostWaker warning seems to often display false positives. These seem to occur when a task has a single waker clone, is woken by value (dropping the waker), and yields after having been woken. This seems to occur the most frequently when a task self-wakes (and that may be the only instance where this occurs?).

It would be nice to fix this — the warning should only be shown when a task definitely won’t be woken again. However, I’m not immediately sure how we would determine this.

One potential solution is that the false-positives seem to be pretty transient. They flicker in and out of existence rapidly. We could potentially just only display the lint if the task has remained in the 0-waker state for a long time.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 20 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I haven’t been able to reproduce the same lost waker problem with vector, using the setup detailed here. PR on the vector side to include the changes: https://github.com/vectordotdev/vector/pull/10825 I am using tokio-console fdc77e28d45da73595320fab8ce56f982c562bb6. The proposed fix looks good!

Maybe we can check if last_wake is after last_poll_started, and if so we can assume it will be polled again?