Repository navigation
🐛 fix(lease): reset the claim in a fork child - #868
Merged
Merged
Conversation
dxbjavid
force-pushed
the
lease-fork-claim-reset
branch
from
October 20, 2026 05:51
98d02a7 to
31342d1
Compare
lease_claim is a field of the lock context, so the base fork reset now clears it alongside the other hold fields rather than a lease-only override. The lease keeps what the base cannot do: recreate the eager claim a shared context needs, as its constructor does. The fragment takes the +name form, and the ownership table in concepts states that a forked child holds no claim, as it does for the sibling locks.
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.
A process that forks while holding a
SoftFileLeasehanded the child a copy of its live claim. The child'stokenandcompromisenamed a claim it never held whileis_lockedreported it unheld, so a worker that inspected its lease after a fork read the parent's state as its own. The child now starts from an unheld claim, as a forked child of the other soft locks does. 🍴The fork reset in the base lock already returns the context to unheld, and the claim is a field of that context, so the base reset clears it with the rest. The lease adds the one step the base cannot take: it recreates the eager claim a shared context needs, so two child threads cannot each create their own, as its constructor does. The parent's claim, heartbeat and marker stay as they were; only the child's copy changes.
The ownership table on the concepts page now states that a forked child holds no claim.