Repository navigation
Conversation
tlq5l
force-pushed
the
fix/cache-concurrent-restore
branch
from
October 19, 2026 22:27
c66fd7f to
07327e7
Compare
…s don't fail Fixes voidzero-dev#846 Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
tlq5l
force-pushed
the
fix/cache-concurrent-restore
branch
from
October 21, 2026 17:46
07327e7 to
f79683a
Compare
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.
Fixes #846
Motivation
When two
vp runprocesses hit the same cache entry at the same time, restoring outputs can fail withFile exists (os error 17):tar'sunpackremoves an existing file and then recreates it withcreate_new, so another process can create the file in between. The same window lets a reader see a missing or half-written file.extract_output_archivenow writes each regular file to a temporary file in the target's directory and renames it over the target, with no lock. This was suggested by @everton-dgn in #846. A failed extraction leaves no temporary file. Entries that are not regular files, whichcreate_output_archivenever writes, still go throughEntry::unpack_in.main.std::fs::rename, which retries with a POSIX-semantics rename whenMoveFileExWis denied;tempfile'spersistdoes not. A target opened withoutFILE_SHARE_DELETEcan still fail. Only CI covers Windows.Ran live: 300 rounds of two concurrent
vt run gencache hits (8 output files), fresh builds.main: 98 of 300 rounds failed, each withFile exists (os error 17). This branch: 0 of 300.