Repository navigation
fix(tooling): join canceled artifact ownership waits - #160057
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. Reviewed September 28, 2026, 12:03 AM ET / 04:03 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch adds cancellable checkout artifact-lock acquisition and a command signal helper, preserves the installed updater's existing wait, and adds lock-race and test-worker coverage. Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open. Current main lacks the signal-aware artifact wait, and the branch provides a coherent slice of the staged tooling repair. The prior cancellation-race finding is addressed; no new code defect was established. Priority: P2 Review scores
Verification
How this fits togetherBuild, lint, and source-update commands use a checkout lock before working with generated artifacts. The lock owner admits one operation, waits through contention, and releases ownership after work and cleanup finish. flowchart LR
A[Tooling or update command] --> B[Artifact ownership request]
B --> C{Cancellation signal supplied?}
C -->|Yes| D[Bounded lock attempts]
C -->|No| E[Native lock wait]
D --> F[Owned artifact work]
E --> F
F --> G[Release ownership]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +366, Other +85. Total +451 across 11 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep artifact acquisition and late-cancellation release in the lock owner, preserve the installed updater's two-argument wait, and have later tooling slices pass signals when their commands become cancellable. Do we have a high-confidence way to reproduce the issue? No high-confidence end-to-end current-main reproduction was run. Source shows an infinite lock wait without a signal, and the PR's focused tests exercise the cancellation race at the lock owner. Is this the best way to solve the issue? Yes for this staged lock-owner slice: bounded dependency attempts are joined, late ownership is released, and the updater's published call shape is preserved. Signal-bearing command activation belongs to later tooling slices. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b9cd492ac60f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Exact head: The published-driver proof requested in the latest review now passes: integrity-verified The existing two-argument no-signal API now explicitly preserves its original single infinite native wait. All eight final lock tests, strict script/root types, typed lint and format pass. The shared preload fix addresses the previous CI failures. Updated PR body contains exact proof and limitations. |
|
🦞👀 Re-review progress:
|
|
Verified the retained command trace for reviewed head The Testbox host workflow is canceled because the warm lease was explicitly stopped after the command completed. The retained command result is exit 0, empty stderr, Retained result: {"publishedDriver":"2026.9.5","driverSha256":"02f998cb3df3950e3ce5e2632cacd2e830bbe4b1348168add271ed4de94a46d2","contentionMs":1100,"prepare":1,"cleanup":1,"publication":0,"status":"ok","lockRemoved":true,"childrenJoined":true,"driverUnchanged":true}I checked the executed assertions: the unchanged published CLI waited on the candidate filesystem lock; the holder's bytes remained unchanged and no preparation/result occurred during contention; releasing it allowed exactly one preparation and cleanup, successful CLI continuation, removed ownership, and joined both process trees. The package integrity and driver digest were verified. The fixture intentionally requested no artifact publication; this proves the published updater's lock-handoff contract, not a full upgrade or publication. No code changed after review. There are no remaining code findings or rank-up moves in the latest comment. Exact-head CI, dependency/security checks, and |
Join signal-aware artifact waits and release ownership won after cancellation. Preserve the published updater native wait contract. Validated cancellation races, published updater lock handoff, and exact-head CI.
Related: #160010
What Problem This Solves
A canceled tooling command could remain queued for checkout artifact ownership. The lock dependency has no AbortSignal API; abandoning an acquisition promise would let canceled work acquire ownership later.
User Impact
Cancellable artifact waits join each bounded acquisition attempt and release ownership if cancellation races acquisition. A command-level signal owner remains installed through cleanup and lock release, then returns the normal signal exit code. Filesystem and unjoined-process failures stay failures.
Published updaters use the existing two-argument API without a signal. They retain the original single native acquisition with an infinite wait. Only signal-bearing callers use bounded polling.
Why This Change Was Made
Acquisition and release remain with the artifact lock owner. The shared cancellation helper owns termination through queueing and cleanup; it does not start a second leaf grace timer or activate compiler memory limits. Fail-closed stale-owner policy and unjoined-work retention remain intact.
Direct and wrapped acquisition now both join release when cancellation races success. Release errors remain visible. This addresses the earlier P2 and rank-up move.
Evidence
[email protected], invoked its unchanged CLI throughupdate --yes --json --no-restartin a private synthetic Git installation, and imported the candidate ownership implementation with its actual fs-safe 0.21.1 dependency. A separate process held checkout ownership through 1,100 ms of observed contention. Preparation stayed blocked until release, then preparation/cleanup each ran once; CLI exited 0, result status wasok, lock was removed, both process trees joined, and published driver bytes stayed unchanged. Corrected fixture placement and stale fixture output before the successful 8.052-second cell. This proves updater lock handoff and continuation, not artifact publication or a full upgrade.02f998cb3df3950e3ce5e2632cacd2e830bbe4b1348168add271ed4de94a46d2. Registry integrity:sha512-TCO/ImVLh5HkF4tdfo7iriIa7kT6iYkIr/jR5ZOkePGFGhUx5Oe7DE716Y1DzzG2teRAVDdCjgJDu1A24Yta7w==.Shared baseline repairs
Adopted baseline
57f1abecc191ea0a54a9af93a6ccb97e6eb87700. Shared CI fixture repairs include existing helper files in isolated checkouts. The Vitest preload now activates only for actual Vitest 5 workers, preserving ordinary child IPC and inherited runtime flags; the worker-specific preload workaround was removed.Same-source proof: 57 affected process/package tests plus forks and threads jsdom tests, 40 lint fixture tests and strict root types, and 11 tests under pinned CI Bun passed. Bun printed a directory-mismatch diagnostic after passing; exit was 0. Optional vmForks assertions passed but teardown failed in unchanged shared setup; recorded follow-up: release shared test setup before VM realm disposal. No configured VM pool lane was found.