fix(storage): serialize root marker repair on Windows - #2438
Merged
Conversation
37 tasks
jackwener
approved these changes
Aug 7, 2026
jackwener
left a comment
Member
There was a problem hiding this comment.
Adversarial review — approve
Root cause fix is sound. Marker identity repair no longer locks the marker inode itself (Windows EBUSY/EPERM). It serializes on the identity-keyed Artifact bootstrap lock — same path artifact writers use — then revalidates root identity + marker before publishMarkerFile(replace).
Checked
- Bootstrap lock path =
sha256(dev:ino)under private control namespace; shared withwithArtifactWriterLockso writer + repair cannot race - In-process gate + OS exclusive lock; O_NOFOLLOW + stable file/ino revalidation
- Concurrent repairs: second fails closed after first mutates marker (1 fulfilled / 1 rejected)
- Owner lock: pre-check rejects non-file at path with
invalid_lock_artifact(clearer than opaque lock_failed) - Initial marker create still uses
publication: 'create'without exclusive path — correct (no existing marker to lock) - Local root-authority suite: 29 pass / 0 fail / 3 skip
No blocking issues.
14 tasks
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.
Summary
Root cause
Windows cannot reliably reread or atomically replace the marker while the marker file itself is exclusively locked. Reads can fail with
EBUSY, and replacement can fail withEPERM. A stable external lock keyed by the real root identity provides serialization without locking the file being replaced.Validation
24 pass / 0 fail / 7 skip38 pass / 0 fail / 10 skipnpm run buildnpm run typecheckgit diff --check692 pass / 9 fail / 47 skip; no failures in the root-authority, marker, or artifact-writer groupsThe remaining full-suite failures are existing Windows/environment backlog and are not presented as green by this PR.
Relates to #2142.