-
Notifications
You must be signed in to change notification settings - Fork 275
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
Geal/clean up dedup on cancel #758
Conversation
✅ Deploy Preview for apollo-router-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
hmm, looks like I created this branch from the wrong one 😅 I'll clean that up. The relevant code is in f261ff9 |
// when _drop_signal is dropped, either by getting out of the block, returning | ||
// the error from ready_oneshot or by cancellation, the drop_sentinel future will | ||
// return with Err(), then we remove the entry from the wait map | ||
let (_drop_signal, drop_sentinel) = oneshot::channel::<()>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could be a mutex rather than a channel.
f261ff9
to
0b441c2
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also update: https://github.com/apollographql/router/blob/main/apollo-router-core/src/cache.rs
to maintain consistency.
|
can we agree to merge this one at least? |
Fix #754
This takes care of cleaning up the wait map by using a oneshot channel as drop signal. This is a pattern that I used a lot in pulsar-rs to perform async tasks on drop