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

Remove waker from wait list when GetConn is dropped #216

Merged

Conversation

cloneable
Copy link
Contributor

@cloneable cloneable commented Dec 1, 2022

This can happen when the task that holds the GetConn future gets woken by another Waker, like when GetConn is wrapped with tokio::time::timeout and similar.

  • Replace the BinaryHeap with PriorityQueue, which supports removals.
  • Refactor the wait list into a separate type to isolate the operations.

Closes #215

@cloneable cloneable force-pushed the queued-waker-removal-on-getconn-drop branch 2 times, most recently from cf771f5 to 4a29161 Compare December 1, 2022 14:25
* Replace the BinaryHeap with PriorityQueue, which supports
  removals.
* Refactor the wait list into a separate type to isolate the
  operations.
@cloneable cloneable force-pushed the queued-waker-removal-on-getconn-drop branch from 4a29161 to dc78d2d Compare December 2, 2022 19:27
@blackbeam
Copy link
Owner

@cloneable, thanks.

@blackbeam blackbeam merged commit 3838ce3 into blackbeam:master Dec 5, 2022
@cloneable cloneable deleted the queued-waker-removal-on-getconn-drop branch December 5, 2022 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove dead waker from waiting list when GetConn is dropped
2 participants