Repository navigation
fix: avoid holding server map lock - #6479
Merged
Merged
Conversation
jedevc
commented
Jan 23, 2024
Contributor
Author
There was a problem hiding this comment.
This is https://github.com/moby/locker, which is used in https://github.com/moby/moby, as well as in upstream https://github.com/moby/buildkit in various places - it's already part of our deps tree.
Merged
sipsma
approved these changes
Jan 23, 2024
sipsma
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Just a naming nit, not a blocker
We should avoid holding the server map lock for any long period of time. This should help to prevent a total deadlock in the case where a rogue server holds the lock for too long during shutdown (for currently unknown reasons). By reducing our usage of the global map lock to only simple operations that won't block, we ensure that this rogue server doesn't block every operation on the controller. However, because of this refactor, we need to introduce a more precise per-server-id lock. This lock is used to prevent multiple incoming session requests from spawning multiple servers for the same ID in parallel. Signed-off-by: Justin Chadwell <[email protected]>
jedevc
force-pushed
the
avoid-server-mu-long-lock
branch
from
January 24, 2024 11:45
5e00e61 to
bdaf692
Compare
jedevc
added a commit
to jedevc/dagger
that referenced
this pull request
Jan 25, 2024
This reverts commit 2aefe55. Because otherwise it's harder to repro.
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.
We should avoid holding the server map lock for any long period of time. This should help to prevent a total deadlock in the case where a rogue server holds the lock for too long during shutdown (for currently unknown reasons).
By reducing our usage of the global map lock to only simple operations that won't block, we ensure that this rogue server doesn't block every operation on the controller.
However, because of this refactor, we need to introduce a more precise per-server-id lock. This lock is used to prevent multiple incoming session requests from spawning multiple servers for the same ID in parallel.