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

Investigate "tasks have lost their waker" and fix if needed #4581

Closed
3 tasks
Tracked by #4747
conradoplg opened this issue Jun 8, 2022 · 3 comments
Closed
3 tasks
Tracked by #4747

Investigate "tasks have lost their waker" and fix if needed #4581

conradoplg opened this issue Jun 8, 2022 · 3 comments
Assignees
Labels
C-enhancement Category: This is an improvement I-slow Problems with performance or responsiveness

Comments

@conradoplg
Copy link
Collaborator

conradoplg commented Jun 8, 2022

Motivation

tokio-console, for which we added support in #4519, is reporting a bunch os "tasks have lost their waker". We should investigate.

Most of them seem to be from the handshake code:

tokio::spawn(async move {
let task = outbound_connector_future.await;

let hs_join = tokio::spawn(dial(
candidate,

// Spawn a new task to drive this handshake.
tokio::spawn(fut.instrument(negotiator_span))
.map(|x: Result<Result<Client, HandshakeError>, JoinError>| Ok(x??))
.boxed()
}

image

Specifications

Designs

  • Investigate the cause of the issue
  • If it's an issue, fix it if possible. If it's too complex, create another issue for it.
  • If it's a false positive, consider reporting it to tokio-console

Related Work

@conradoplg conradoplg added C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage P-Medium ⚡ I-slow Problems with performance or responsiveness labels Jun 8, 2022
@ftm1000 ftm1000 added P-High 🔥 and removed P-Medium ⚡ S-needs-triage Status: A bug report needs triage labels Jun 20, 2022
@teor2345
Copy link
Contributor

teor2345 commented Jul 4, 2022

I've had a look at all the lost wakers, and they seem pretty harmless.

If we're just dropping wakers for handshakes we're not using any more, that's probably a task cleanup bug. And we make new handshakes as needed anyway.

@teor2345
Copy link
Contributor

teor2345 commented Jul 4, 2022

The warning might also be incorrect or confusing, I'm still seeing the poll number for those tasks going up, even after the lost waker warning.

But handshakes should only last for 4 seconds, so there's definitely a bug here.

@teor2345 teor2345 self-assigned this Jul 12, 2022
@teor2345
Copy link
Contributor

This appears to be a known bug in tokio-console, related to tasks spawning other tasks:
tokio-rs/console#345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: This is an improvement I-slow Problems with performance or responsiveness
Projects
None yet
Development

No branches or pull requests

4 participants
@conradoplg @teor2345 @ftm1000 and others