Repository navigation
Release cargo's build locks explicitly (fixes flaky citizen_workspace_pool reclaim) - #5238
Merged
Merged
Conversation
Contributor
Author
|
PASS #5238 at dd42301, Cormac. Claim checked: the reclaim releases cargo's flock even while a forked child still shares the descriptor, and the move is otherwise pure.
|
…cargo_target is its own owner The flaky "kept" (canary 9c2e7b8, CI run 39444285785; #5232 c776905) is a real defect, not a test artifact. A reclaim pass released cargo's flock only by closing its descriptor. A flock belongs to the open file description, so a process forked while the pass held it (the core spawns git, engines and builds; tests fork in parallel) kept it until its exec, and the next pass read an idle tree as a live build. - HeldCargoLocks owns the held locks and unlocks each one on drop; a failed unlock is a probe, never silent. - Proving a tree is cargo's, holding its locks and taking it move to citizen_workspace_pool/cargo_target.rs (parent 993 -> 876 lines); callers unchanged (is_cargo_target re-exported pub(crate)). - Regression test: a dup standing in for the forked child stays open past the release, and the lock must still be free. Deterministic. Measured: a standalone rustc probe on the M5 (macOS, Darwin 25.5) showed a rival try_lock fails after close-only with a dup alive (false) and succeeds after an explicit unlock (true). continuum-core compile/test is left to CI (serving node, no build window); source-hygiene 43/43 at baseline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo (cherry picked from commit dd42301)
joelteply
force-pushed
the
fable/cargo-lock-released-explicitly
branch
from
October 21, 2026 07:14
dd42301 to
9ba0e5d
Compare
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.
Stacked on #5228; retargets to canary once the chain lands.
Defect
only_idle_cargo_tagged_output_is_reclaimed_and_her_work_staysfailed on canary 9c2e7b8 (run 39444285785) and on #5232 withleft: ["kept"] right: ["reclaimed"]. A reclaim pass released cargo's flock only by closing its fd. A flock belongs to the open file description, so a child forked during the hold (the core spawns git/engines/builds; tests fork in parallel) keeps the lock until exec, and the next pass sees a live build.Change
HeldCargoLocksowns held locks and unlocks each on drop (failure is a probe).citizen_workspace_pool/cargo_target.rs(parent 993 -> 876 lines). Callers unchanged.Measured
try_lockafter close-only with dup alive = false; after explicit unlock = true.cargo test -p source-hygiene43/43, every ratchet at baseline.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo