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

JoinHandle wakers are kept alive longer than necessary #6505

Open
Darksonn opened this issue Apr 21, 2024 · 0 comments
Open

JoinHandle wakers are kept alive longer than necessary #6505

Darksonn opened this issue Apr 21, 2024 · 0 comments
Labels
A-tokio Area: The main tokio crate M-task Module: tokio/task

Comments

@Darksonn
Copy link
Contributor

Currently, the waker registered with a JoinHandle is not dropped until the task allocation is dropped. This means that if two tasks await each other's JoinHandle, then they will form a reference cycle and the task allocation will never be freed.

The JoinHandle waker should be dropped eagerly once the task has completed and the JoinHandle is dropped.

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-task Module: tokio/task labels Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-task Module: tokio/task
Projects
None yet
Development

No branches or pull requests

1 participant