Repository navigation
fix(fork): an access-time update no longer discards a fresh fork validation - #14799
Conversation
…dation SharedLiveAgentIndex installs a vnode watch on the agent executable before running the fork capability probe, and keeps the validation only while that watch's generation survives. The probe's first run of a freshly written or updated executable updates its access time, and Darwin reports that as NOTE_ATTRIB. The watch treated it like a real change and invalidated the validation it had just produced, so prepareForkAvailabilityProbe returned false depending on whether the main-actor invalidation landed before or after the generation check. That is the flake behind WorkspaceForkConversationContextMenuTests' sharedForkProbe* executable-watch tests (all probe a just-written pi script). It is not file-descriptor headroom: without a watch the validation is kept with refreshBeforeReuse and prepareForkAvailabilityProbe still returns true. An attrib-only event now invalidates only when the inode's ctime moved (chmod, chown, xattr); an atime-only update leaves ctime unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 6 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
|
Merge receipt for |
cc90659 test: a window with no restorable workspaces is dropped from the snapshot (manaflow-ai#14801) 9b10f7c Merge pull request manaflow-ai#14756 from manaflow-ai/12956-ssh-auth-followup-main fb665a0 test(ime): install option-as-alt right before the dead-key dispatch (manaflow-ai#14800) 9d459e3 fix(fork): an access-time update no longer discards a fresh fork validation (manaflow-ai#14799) 39e2c3a fix(ssh): share one route check across concurrent cmux ssh opens c344ce9 test: cover concurrent cmux ssh opens sharing one route check 9ff9017 fix(ssh): report OpenSSH failures from cmux ssh instead of a Cloud VM error 311797d test: cover cmux ssh failing fast on refused and unreachable hosts
Summary
The
sharedForkProbe*executable-watch tests inWorkspaceForkConversationContextMenuTestsfail intermittently: on #14785, and on main in run 36197594615. The failures:...InvalidatesWhenExecutableChanges...InvalidatesWhenPathDirectorySymlinkRetargets...SharesExecutableWatchAcrossPanelsWithSameExecutable...InvalidatesWhenEarlierPathExecutableAppearsForPiAndOmpIn each one,
prepareForkAvailabilityProbereturns false right afterrefreshForkAvailabilityNow.Root cause
applyPendingForkValidationsdoes two things around the probe:The probe's first run of a freshly written or updated executable updates the file's access time, and Darwin reports that as
NOTE_ATTRIB. I reproduced it with a standalone kqueue script. Over 5 fresh files each, the first exec firedNOTE_ATTRIB5/5 times. When the file had already been executed once before the watch was installed, it fired 0/5. The probe was invalidating its own result. Whether the test saw it depended on when the main-actor invalidation ran relative to the check, which is why it flakes. Real users hit the same thing once after installing or updating an agent binary: fork availability is dropped and has to be re-probed.The file-descriptor headroom theory is ruled out. When the watch budget is exhausted, the validation is still stored with
refreshBeforeReuse, andprepareForkAvailabilityProbereturns true (seesharedForkProbeValidationRefreshesBeforeReuseWhenWatchPathBudgetIsExceeded). The app also raisesRLIMIT_NOFILEto 65536 at startup.Change
An attrib-only event now invalidates only when the inode's ctime changed. A real chmod, chown or xattr change moves ctime; an access-time-only update does not. Writes, deletes, renames and link changes invalidate exactly as before.
New regression test:
sharedForkProbeValidationSurvivesTheProbeRunningAFreshExecutable. It probes a just-writtenpi, waits 300 ms for the watch event, then asserts the validation is still there.Test plan
WorkspaceForkConversationContextMenuTestsgreen🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes a flaky fork-availability validation that was being discarded by the probe that created it. The first run of a freshly written or updated executable updates its access time, which Darwin reports as
NOTE_ATTRIB; the executable watch treated that as a real change and invalidated the validation it had just produced. Real changes (chmod, chown, xattr) still work as before.sharedForkProbeValidationSurvivesTheProbeRunningAFreshExecutableto cover the regression.Written for commit c74ec13. Summary will update on new commits.