This repository was archived by the owner on Nov 19, 2026. It is now read-only.
Repository navigation
lockfile: add RecursiveLock() API - #347
Merged
Merged
Conversation
Member
|
LGTM, but definitely want some other head nods. |
nalind
reviewed
May 16, 2019
Member
Author
Member
Author
Member
|
I am fine with this, but we need @nalind review. |
Member
|
Looks reasonable, but I'd like a test that ensures that mixing recursive and non-recursive write locks in a single process doesn't unexpectedly break. |
Member
Author
|
Great idea. I will update the PR and re-ping once the new tests are green. |
Add a RecursiveLock() API to allow for recursive acquisitions of a writer lock within the same process space. This is yet another requirement for the copy-detection mechanism in containers/image where multiple goroutines can be pulling the same blob. Having a recursive lock avoids a complex synchronization mechanism as the commit order is determinted by the corresponding index in the image. Signed-off-by: Valentin Rothberg <[email protected]>
vrothberg
force-pushed
the
recursive-locks
branch
from
May 22, 2019 15:05
c8c9668 to
237602b
Compare
vrothberg
commented
May 22, 2019
| } | ||
| } | ||
|
|
||
| func TestLockfileMixedConcurrentRecursiveWriters(t *testing.T) { |
Member
|
@nalind Can we merge this so we can create a new version? |
Member
|
LGTM |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Add a RecursiveLock() API to allow for recursive acquisitions of a
writer lock within the same process space. This is yet another
requirement for the copy-detection mechanism in containers/image where
multiple goroutines can be pulling the same blob. Having a recursive
lock avoids a complex synchronization mechanism as the commit order is
determinted by the corresponding index in the image.
Signed-off-by: Valentin Rothberg [email protected]