Repository navigation
fix(deploy): a deploy's release clears only its OWN claim, so a failed consumer can no longer free the gate under a live build (card 6a62fbd1) - #4439
Merged
Conversation
…d consumer can no longer free the gate under a live build (card 6a62fbd1) IntelMac, 2026-09-27. The 2989557 consumer failed its verify (DEPLOY MISMATCH: the tree had moved to dc9f3a1 under it). Its DeployClaimGuard dropped and deploy_claim::clear removed the claim file unconditionally, but that file was no longer its claim: the live dc9f3a1 consumer had written it. The tracker then read in_flight=false and started a third consumer, which checked out 8c24fde under the live build. That build is now doomed to the same mismatch, and its own drop will clear the third consumer's claim in turn. Each failure frees the gate for the next collision, so the node never deploys. clear(root, pid) now removes the claim only if the claim on disk is still pid's. Both callers are owner-scoped: the guard's drop passes its own pid, and the abandoned-claim sweep passes the pid it judged abandoned, so a sweep racing a fresh claim can't delete it either. Renewal (#4436) already had this rule, via renew() stamping only its own claim; the release was the one path without it. Test (runtime/deploy_claim.rs, the existing round-trip test): a foreign pid's clear leaves the claim, the owner's removes it, and a repeat clear is idempotent. Also removes a detached doc line ("Drop the claim") that sat above owner_alive. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
enabled auto-merge (squash)
September 27, 2026 03:24
joelteply
commented
Sep 27, 2026
joelteply
left a comment
Contributor
Author
There was a problem hiding this comment.
Word: APPROVED at 08a7f785b, once CI is green (CI is the compile, as the PR says).
Checked:
clear(root, pid)removes the file only when the claim on disk ispid's.- The guard's drop passes its own pid.
- The abandoned-claim sweep in
deploy_gatepasses the abandoned claim's pid fromDeployGate::Abandoned { pid, .. }, not this process's, so a sweep racing a fresh claim can't delete it. - The round-trip test pins all three behaviors: a foreign clear leaves the claim, the owner's clear removes it, and a repeat clear is idempotent.
- Release now follows the same rule renewal already had in #4436.
Non-blocking note: read-then-remove leaves a microsecond window. A new claim renamed into place between read and remove_file would be deleted. The sweep path is where that could actually happen, when a deploy starts at the moment a stale claim is swept. If it ever shows up, the fix is to hold take_install_lease across the claim's write and clear, or to rename the claim to a pid-scoped tombstone, re-read it, and restore it if it's foreign. Not needed to break tonight's loop.
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.
IntelMac, 2026-09-27. The 2989557 consumer failed its verify (DEPLOY MISMATCH: the tree
had moved to dc9f3a1 under it). Its DeployClaimGuard dropped and deploy_claim::clear
removed the claim file unconditionally, but that file was no longer its claim: the live
dc9f3a1 consumer had written it. The tracker then read in_flight=false and started a
third consumer, which checked out 8c24fde under the live build. That build is now doomed
to the same mismatch, and its own drop will clear the third consumer's claim in turn. Each
failure frees the gate for the next collision, so the node never deploys.
clear(root, pid) now removes the claim only if the claim on disk is still pid's. Both
callers are owner-scoped: the guard's drop passes its own pid, and the abandoned-claim
sweep passes the pid it judged abandoned, so a sweep racing a fresh claim can't delete it
either. Renewal (#4436) already had this rule, via renew() stamping only its own claim; the
release was the one path without it.
Test (runtime/deploy_claim.rs, the existing round-trip test): a foreign pid's clear leaves
the claim, the owner's removes it, and a repeat clear is idempotent.
Also removes a detached doc line ("Drop the claim") that sat above owner_alive.
Not compiled on the IntelMac: its deploy build holds the machine. CI is the compile.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE