Repository navigation
Fix checkpoint retries stuck on a rejected snapshot - #3727
Open
Ferran Pons Serra (ferponse) wants to merge 1 commit into
Open
Ferran Pons Serra (ferponse) wants to merge 1 commit into
Ferran Pons Serra (ferponse) wants to merge 1 commit into
Conversation
ReuseCheckpoint called os.Stat on names from the completion marker. os.Stat follows symlinks, and filepath.Join lets ".." leave the directory. The worker returned that list, atelet rejected it, and the marker stayed, so a retry returned the same list. Check the names with ValidateSnapshotFileNames and require a regular file from os.Root.Lstat. A miss returns nil and the caller checkpoints again. Signed-off-by: Ferran Pons Serra <ferranponsuniversidad@gmail.com> Co-authored-by: Ferran Pons Serra <ferponse@users.noreply.github.com>
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.
ReuseCheckpointaccepted snapshot names from the completion marker that atelet then rejected.os.Statfollows symlinks, andfilepath.Joinaccepts.., so the list can name a file outside the checkpoint directory. atelet rejects that list, the marker stays, and the nextCheckpointWorkloadreturns the same list.Names now have to pass
ValidateSnapshotFileNames, andos.Root.Lstathas to show a regular file. Any failure returns nil. gVisor and microVMCheckpointWorkloadthen take a fresh checkpoint, which clears the directory.Before this change,
TestReuseCheckpointSnapshotNamesfailed for a symlink, a symlink directory, a..name, and a nested name. After it,go vet ./internal/ateworker/is clean andgo test -race -count=3 -shuffle=on ./internal/ateworker/passes.AI use: AI-assisted. An agent wrote the change and ran the tests above.