Repository navigation
Backtrack when the sandboxer cannot find a process input - #23748
Merged
Merged
Conversation
With the sandboxer, a missing input reached prepare_workdir as text, so the run failed instead of backtracking, and the sandboxer was restarted. The sandboxer now answers a missing digest with NotFound, on which Sandboxer does not restart it. prepare_workdir then asks Store::ensure_downloaded for the typed MissingDigest that backtracking needs, or retries once if nothing is missing.
jgranstrom
marked this pull request as ready for review
November 3, 2026 20:28
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 the sandboxer, missing process input doesn't trigger backtracking as the error is returned as a string instead of
StoreError::MissingDigest. So under pantsd every run with missing input fails, until pantsd is restarted. Without the sandboxer this backtracks since #23027.With this PR
MissingDigestwithNotFound, other errors stayFailedPreconditionStore::ensure_downloadedfor the missing digest as a typed error, like the non-sandboxer path. If nothing is missing, it asks the sandboxer again.NotFoundTested end to end, with a warm pantsd and a deleted process output. On main every run fails and the sandboxer starts 3 times. With this change the first run backtracks and succeeds, the next is a cache hit, and the sandboxer starts once.
Disclosure: Implemented and verified with Claude with human direction