Retry transient Windows atomic file replacements - #10
Merged
Merged
Conversation
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.
Atomic state publication can fail on Windows when a reader briefly holds the destination. Retry native Windows errors 5 and 32 at the replacement step, using the same completed temporary file. The first attempt stays immediate; at most six retries request 0.63 seconds of sleep per replacement. Exhausted failures still propagate through existing cleanup and caller handling.
The change applies to atomic text and byte writes. It preserves locking, preflight, write guards, fsync, immutable publication and existing generated-view warning behavior. Independent adversarial reviewers agreed on the demonstrated failure mechanism and repair before implementation. The original CI log does not identify the process that held the file.
Validation:
GitHub Actions run #35 passed on its first attempt for head
1f932a725052fb1fe9a205bf141d770f33c47800. All four jobs passed compilation, unit tests and canonical benchmark gates:Each job discovered 294 tests. Both Windows jobs passed all nine new regressions; Linux passed the four portable cases and skipped the five native Windows cases. The original 24-process startup test and historical-version waiter passed in all four jobs. Skips are not passes: each job still skips the pre-existing archive-path setup collision, alongside its listed platform/privilege exclusions.
GitHub tested merge commit
a22cb5f44d60815ee543cd7358bec6ccd65d842a; its tree was independently verified identical to the reviewed head tree. The actual PR remains unmerged.