Repository navigation
Record fork lane acquisition independently of filesystem time - #4996
Merged
Merged
Conversation
leaf-agent
reviewed
Nov 1, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
[P2] Cutoff publication can take a message back from the session. The writer lock serializes takers, but readers can still observe the gap between sampling the cutoff and publishing it; acquisition needs to be consistent with admission and delivery readers too.
leaf-agent
approved these changes
Nov 1, 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.
A fork follower could claim a message that arrived before it took over the lane. The cutoff came from inode
ctime, which can trail the event clock on Linux; CI exposed this intest_a_lane_counts_from_when_it_took_the_namewhile landing #4991.Record the admission cutoff explicitly after taking the lane. A fork-specific transition lock makes lease replacement and cutoff publication atomic to readers, so a message cannot first wake the session and then become held. The lock is separate from the delivery lock that some readers already hold. The kernel lease remains the sole proof that the follower is live; generic wait leases keep their current format.
Validation: 22 focused cases passed, including all 15 fork tests, real browser admission blocked during publication, pre-cutoff delivery, Codex delivery under its existing session lock, and session retirement. The stale-filesystem-time control fails at the original assertion. Independent review, Ruff check/format, diff checks and full
pnpm run checkpassed; the committed protocol baseline includes the new record. The clock failure mechanism is reproduced on main; the original CI runner’s timestamp values were not captured.