Repository navigation
fix: postpone base image updates while sessions are running - #56
Open
raphaelcoeffic wants to merge 1 commit into
Open
raphaelcoeffic wants to merge 1 commit into
raphaelcoeffic wants to merge 1 commit into
Conversation
New sessions join the shared mount of the running ones, on the current base image, and replacing the base image files under their mounted overlay breaks them (lower layer changes are undefined for overlayfs). When dive sessions are running and the base image would change, keep the current one and warn: 1 dive session is running: base image update postponed until it exits The overlay locks are held during the check and the update: a session holds its lock from joining or creating the shared mount until its pid file exists, so it is either seen as running or starts after the update.
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.
New sessions join the shared mount namespace of the running ones, on the current base image. Replacing the base image files under their mounted overlay breaks them (lower layer changes are undefined behavior for overlayfs).
Change
dive::cleanup::active_sessions) and the base image would change (newbase_image_outdated, sharing the hash comparison withupdate_base_image), keep the current base image and warn:{rootful,rootless}/lock) are held during the check and the update. A session holds its lock from joining or creating the shared mount until its pid file exists, so it is either seen as running, or starts after the update.Complements #55: the overlay sync it adds runs when the overlay is mounted, i.e. on the first session after the update.
Testing
End to end, rootful
alpine:3.22container, scratch state directory, base image 0.2.7 installed by the release binary:-bwith the base image artifact of main run #198) → warning above, runs on the current base image, base image on disk unchanged; A's base image still intact when it exitscargo check --features embedded_image(the release build's code path)