Repository navigation
Judge and take a lease at one instant - #475
Merged
Merged
Conversation
Owner
Author
This was referenced Dec 1, 2026
Owner
Author
Merge activity
|
benschac
force-pushed
the
cairn-fixes/landed-review-lease-races
branch
2 times, most recently
from
December 1, 2026 17:28
5d60b15 to
ed06bd1
Compare
benschac
changed the base branch from
cairn-fixes/landed-review-retired-stage
to
graphite-base/475
December 1, 2026 17:33
Codex found five races between reading a lease and acting on it. A plan claim could be taken after its owner had renewed: both takeover writes now require the lease to be the one that was judged, and a retry reads the decision again. prd status judged leases while holding the lock that blocks renewals: it now judges every row at the instant it took the lock. init never renewed its lease: it starts once .cairn is in place. A renewal that waited for the write lock was stamped with the time it started waiting: it is stamped once it holds the lock. A clock set back kept a dead owner's lease fresh until the clock caught up: a renewal more than 30 seconds ahead of the clock counts as lapsed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
benschac
force-pushed
the
cairn-fixes/landed-review-lease-races
branch
from
December 1, 2026 17:35
ed06bd1 to
19d6e6e
Compare
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.

Codex found five races between reading a lease and acting on it.
A plan claim could be taken after its owner had renewed: both takeover writes now require the lease to be the one that was judged, and a retry reads the decision again. prd status judged leases while holding the lock that blocks renewals: it now judges every row at the instant it took the lock. init never renewed its lease: it starts once .cairn is in place. A renewal that waited for the write lock was stamped with the time it started waiting: it is stamped once it holds the lock. A clock set back kept a dead owner's lease fresh until the clock caught up: a renewal more than 30 seconds ahead of the clock counts as lapsed.
Co-Authored-By: Claude Fable 5.2 noreply@anthropic.com
What this changes
Checks
Provenance
Review by Codex
This commit fixes what Codex's first round found on #456. Its second round, on this commit, found two things, left open because two rounds are done:
renewed_attimestamp, not a renewal generation, so a renewal that writes the same millisecond goes unnoticed.🤖 Generated with Claude Code