Repository navigation
fix(block): read mountinfo once for all the binds - #1205
Closed
sapnasingh4852-source wants to merge 2 commits into
Closed
sapnasingh4852-source wants to merge 2 commits into
sapnasingh4852-source wants to merge 2 commits into
Conversation
getBlockVolumes called getMountInfo for every bind mount, and each call re-read and re-parsed /proc/thread-self/mountinfo. Resolve every bind against one snapshot instead, and refresh that snapshot after an unmount since unmounting a source changes the table the next lookup needs. Signed-off-by: sapnasingh4852-source <sapnasingh4852@gmail.com>
👷 Deploy request for urunc pending review.Visit the deploys page to approve it
|
Contributor
|
This PR does not follow the contribution guidelines: Please ensure:
|
Fixes: urunc-dev#1166 Signed-off-by: sapnasingh4852-source <sapnasingh4852@gmail.com>
sapnasingh4852-source
marked this pull request as draft
November 12, 2026 13:19
Author
|
added myself to contributors.yaml in 76c6360. also can't run e2e here, macos no kvm. saw invalid just now, i opened this before 1166 got any label. is it going to be triaged? |
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.
Description
getBlockVolumescalledgetMountInfofor every bind mount, and every call re-read and re-parsed/proc/thread-self/mountinfo. With N binds that is N reads of the same file before anything changes.This resolves all the binds against one snapshot of the mount table. The snapshot is refreshed right after an unmount, because unmounting a source changes the table and the following lookups have to see that change (the existing
ErrMountpoint/ shared-source behaviour per bind is unchanged).The second commit adds me to
.github/contributors.yaml, as the contribution guide asks.Related issues
#1166has no label yet, so the PR stays a draft until it is triaged.How was this tested?
I could not run the e2e suites: this machine is macOS, so the package only builds for linux, and there is no KVM / containerd here to boot a guest.
What I could run:
gofmtclean,GOOS=linux go build ./pkg/unikontainers/...,GOOS=linux go vet ./pkg/unikontainers/.TestBlockVolumesShareMountInfoSnapshot: 8 binds whose sources are not mounted, asserts the mount table is read exactly once. Runs undermake unitteston linux.BenchmarkBlockVolumesShareMountInfoSnapshot: 32 binds, one parse per call instead of 32.The refresh branch after
unmountneeds a real mount, so it is only exercised by e2e, not by the unit test.Please add
ok-to-testso the e2e suites run here; that is the only way I can satisfy the "all tests run" rule from this machine.LLM usage
Qoder coding agent assisted with the refactor, the test and the PR text. I read the LLM policy and reviewed the diff.
Checklist
make lint) —make lintruns the golangci image and there is no container runtime on this machine.make test_ctr,make test_nerdctl,make test_docker,make test_crictl) — not run, see above; waiting forok-to-test.