Merged
Conversation
fmt update blocking_ask_workers_to_stop
93869e0 to
ff006d0
Compare
timvisee
reviewed
Dec 1, 2025
timvisee
approved these changes
Dec 1, 2025
3 tasks
timvisee
added a commit
that referenced
this pull request
Dec 3, 2025
* sync function to ask to stop workers fmt update blocking_ask_workers_to_stop * graceful shard stop on ShardReplicaSet changes * make stop consuming * implement graceful stop for replica set * graceful shard stop in start_resharding_unchecked * stop_gracefully fn on shard_holder * collection graceful stop on delete * explain when it is ok to shutdown * fix tests and ensure blocking callsa are not called from async runtime * fmt * Annotate cancel safety for do_recover_from_snapshot function * Minor comment nit * make drop not wait on stop thread * graceful stop in more tests * graceful stop in more tests * avoid background thread is shard was stopped gracefully * annotate cancel safety * fmt * More cancel safety annotations * Add two spawns to ensure cancel safety --------- Co-authored-by: timvisee <tim@visee.me>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
Having long running
stop_gracefullyfunction inside Drop is bad on it's own, but even worse if this long drop needs to call for async runtime operations.In our case it created a situation, where Drop can not finish because it wants to spawn another async task on a runtime, which is has already used for drop itself. This results in a Deadlock, in those cases when runtime has only one available thread.
This PR refactors Drop in a way, that it only makes very small and syncronous operations, while relying on external explicit shutdown, which should be executed on a real async runtime.
Recommed to review by commits