Repository navigation
syncsetup: an ownership check that finds another holder retires the send receipt first - #2180
Merged
Merged
Conversation
…end receipt first When CheckLease finds another computer holding the chat, Batcher.Displaced marks the batcher stale, and that mark already wakes renewal readers through endRenewals. The send receipt was only retired later, in becomeViewer, so a reader woken by that first notice still found a receipt for a hold another computer has (contract K2). The another-holder branch now retires the receipt it read before the check, after in-flight seals and before Displaced, in a small helper so CheckLease does not grow.
santoshkumarradha
marked this pull request as ready for review
November 2, 2026 11:23
This was referenced Nov 2, 2026
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.
What changes for a person
When the relay's watch says another computer took a chat over, this window's send receipt (the hold it publishes under) is now gone before anything is told the hold changed. Before, the first renewal notice arrived while the receipt was still on disk, so a reader woken by it could still find a receipt for a chat another computer holds.
Root cause
In
Drive.CheckLease, the another-holder branch callsBatcher.Displaced, which marks the batcher stale, and that mark already wakes renewal readers. The receipt was only retired later, inbecomeViewer. The merge of dev into app/v3 (#2099) moved the receipt out of the early retirement on purpose (a hold this computer still has keeps its receipt), but in this branch another computer is known to hold the chat. The branch now retires the receipt it read before the check, after in-flight seals settle and beforeDisplaced, in a small helper.Validation
TestWatchDisplacementRetiresTheDriveHoldImmediately/another_holder(internal/syncsetup) is the regression test. It needs the real engine. With the pinned furrow engine present it failed on app/v3 (watch displacement retained its hold file) and passes with this change, 3 of 3 runs. Thehigher_local_fencecase, where this computer keeps its receipt, still passes.BUILD_EXIT=0 VET_EXIT=0 FMT_EXIT=0 CHANGELOG_EXIT=0 LAWS_EXIT=2 PKG_EXIT=1 (./internal/syncsetup). LAWS_EXIT=2 comes from the known base reds only: TestSourceComments, which flags two factory pipeline_copy files; the taxonomy law; and the two NoRoad complexity laws. PKG_EXIT=1 comes from four syncsetup seal reds that sibling PRs fix (tests: damage the teams store, not a teams.json, before continuing a chat #2182, tests: F1 reopen resumes the same hold (stale-consent and hosted take-back tests) #2183, tests: keeping an unsent turn on an ownership check needs the store to answer #2184, tests: the stale-publish test waits for the announced move, not the first viewer line #2185). TestWatchDisplacementRetiresTheDriveHoldImmediately passes.Limits
A heartbeat that finds the hold gone without naming the holder still goes through the batcher's stale mark first. There the holder can be this computer at a newer fence, which keeps its receipt, so that path is unchanged.
🤖 Generated with Claude Code