Repository navigation
imagecache: replace mountinfo scan with statx - #3835
Draft
Diamond (diamondburned) wants to merge 1 commit into
Draft
Diamond (diamondburned) wants to merge 1 commit into
Diamond (diamondburned) wants to merge 1 commit into
Conversation
UnmountAllUnder parsed /proc/self/mountinfo on every actor restore and teardown, scanning all cached overlay layer mounts on the node under the kernel mount-namespace lock. Walk the target directory with dirfd-relative statx and STATX_ATTR_MOUNT_ROOT across bounded passes instead, skipping overlay upper and work scratch trees and unmounted bundle rootfs and volume directories, failing loudly if STATX_ATTR_MOUNT_ROOT is unsupported, and detaching broken or disconnected mounts that fail statx with ENOTCONN, ESTALE, or EIO. Delete the now-unused mountinfo parser and its unit test.
This branch has not been deployed
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.
Summary
UnmountAllUnderparsed/proc/self/mountinfoon every actor restore and teardown, scanning all cached overlay layer mounts on the node under the kernel mount-namespace lock.statxandSTATX_ATTR_MOUNT_ROOTacross bounded passes instead, skipping overlayupper/workscratch trees and unmounted bundlerootfs/volumedirectories.STATX_ATTR_MOUNT_ROOTis unsupported on the backing filesystem, and detaches broken or disconnected mounts that failstatx/open/readdirwithENOTCONN,ESTALE, orEIO.mountinfoparser and its unit test, and addsBenchmarkUnmountAllUndercomparing bundle unmount under ambient mount-table noise.Benchmark (
benchstat)Reproducible on Cloudtop via
unshare -Urm go test -run='^$' -bench='^BenchmarkUnmountAllUnder$' -benchmem -count=10 ./internal/imagecache:Verification
go test -race -count=3 -shuffle=on ./internal/imagecache/...unshare -Urm go test -count=1 -v -run Unmount ./internal/imagecache/..../hack/verify/boilerplate.sh && ./hack/verify/gofmt.sh && ./hack/verify/package-deps.sh🤖 PR was made with the use of generative AI.