volume: Don't decrement refcount below 0 #47530
Merged
vvoland merged 1 commit intomoby:masterfrom Mar 8, 2024
Merged
Conversation
08ac39b to
afa01ac
Compare
Contributor
Author
|
The CI is green after running the test 30x times: afa01ac |
afa01ac to
2ff2740
Compare
thaJeztah
reviewed
Mar 7, 2024
| if v.needsMount() { | ||
| v.active.count-- | ||
| logger.WithField("active mounts", v.active).Debug("Decremented active mount count") | ||
| if v.active.count > 0 { |
With both rootless and live restore enabled, there's some race condition which causes the container to be `Unmount`ed before the refcount is restored. This makes sure we don't underflow the refcount (uint64) when decrementing it. The root cause of this race condition still needs to be investigated and fixed, but at least this unflakies the `TestLiveRestore`. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2ff2740 to
294fc97
Compare
This was referenced Mar 8, 2024
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.
With both rootless and live restore enabled, there's some race condition which causes the container to be
Unmounted before the refcount is restored.This makes sure we don't underflow the refcount (uint64) when decrementing it.
The root cause of this race condition still needs to be investigated and fixed, but at least this unflakies the
TestLiveRestore.- How to verify it
Check
TestLiveRestoreThe CI is green after running the test 30x times: afa01ac
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)