Skip to content

🐛 fix(lease): reset the claim in a fork child - #868

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
dxbjavid:lease-fork-claim-reset
Oct 28, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
dxbjavid:lease-fork-claim-reset

Conversation

@dxbjavid

@dxbjavid dxbjavid commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

A process that forks while holding a SoftFileLease handed the child a copy of its live claim. The child's token and compromise named a claim it never held while is_locked reported 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.

@dxbjavid
dxbjavid force-pushed the lease-fork-claim-reset branch from 98d02a7 to 31342d1 Compare October 20, 2026 05:51
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.
@gaborbernat gaborbernat changed the title fix(lease): reset a lease's claim in the fork child 🐛 fix(lease): reset the claim in a fork child Oct 28, 2026
@gaborbernat gaborbernat reopened this Oct 28, 2026
@gaborbernat
gaborbernat merged commit adbcde9 into tox-dev:main Oct 28, 2026
71 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants