Repository navigation
fix(verifiers): keep the signal fixture root until its owners finish - #8705
abhisheksharma001 wants to merge 1 commit into
Conversation
The signal recording verifier read /proc/self/limits after acquiring its private root but before owning its cleanup, and its cleanup closed the root even when the MCP client or transport refused to close. Read the limits before the root exists, construct the owners inside the cleanup scope, and release the root only after every owner closed and the verifier's process lineage verified; otherwise retain it and name it. Fixes morluto#8561. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
[Medium impact] The reviewed changes appear safe to merge; no actionable defect was established. SummaryThe verifier now reads inherited limits before creating its fixture directory. Cleanup attempts both MCP owner closes and checks process lineage before removing that directory.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Read inherited limits] --> B[Create fixture root]
B --> C[Run verifier operation]
C --> D[Attempt both owner closes]
D --> E{Both closes succeeded?}
E -- No --> R[Retain root and report failures]
E -- Yes --> F[Observe process lineage]
F --> G{Verified with no descendants?}
G -- No --> R
G -- Yes --> H[Remove fixture root]
Reviews (1) · Last reviewed commit: "fix(verifiers): keep the signal fixture ..." · Reviewed by Greptile |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
TL;DR: On Node 22.23.4, 24.22.1 and 26.12.1, all 5 tests pass at the PR head. With the old
Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- tests/boundary/process/signalVerifierCleanup.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
Summary
Fixes #8561.
scripts/verify-signal-recording.mjsacquired its private fixture root, then awaited/proc/self/limitsoutside any cleanup ownership, and its cleanup closed the root even when the MCP client or transport refused to close. A failed limits read leaked the root; a refused owner close removed the directory the surviving child could still be using.Problem and expected behavior
Reported: the verifier allocates the root before reading
/proc/self/limitsoutside the cleanup scope, and its cleanup attempts client, transport and root closes independently, so root close runs even when both MCP closes fail. Expected: enter cleanup ownership immediately after root acquisition, retain the root while acquired ownership is unresolved, preserve every failure, and establish owned process completion before release.Change and scope
scripts/verify-signal-recording.mjs: the inherited address-space limit is read before the root exists, so nothing acquired can leak if that read fails. The MCP client and transport are constructed inside thewithVerifierCleanupoperation, so no work is awaited between root acquisition and its cleanup ownership. Cleanup is one owned task: close the client and transport throughcloseVerifierResources(both are attempted, every refusal retained), observe the verifier's process lineage withcompleteVerifierRunand require it verified withassertVerifierCleanupComplete, then close the root. A refused owner close or unverified lineage leaves the root in place and the thrown error names the retained root path with the original failures as its cause. The final report reuses the lineage observed before release.Contribution scope: ordinary fix within existing verifier boundaries; maintainer scope decision not applicable.
Contract and boundary impact
Semantic owner and earliest changed stage: the verifier's own ownership order; shared helpers (
verifier-cleanup.mjs,verifier-run.mjs) are unchanged.Contribution scope fit and linked maintainer decision: not applicable.
CLI and MCP/tool-catalog contract: none.
Provider, bridge, target-format, or platform compatibility: Linux-only verifier as before; the lineage check uses the existing
/procobserver.Evidence, artifact, provenance, or reconstruction contract: none.
Target selection, authority, upstream behavior, and cleanup details: the root is now retained on any unresolved ownership; its path is reported in the failure.
Generated metadata, package, or installation impact: none.
Read existing files or captured data.
Evidence and regression coverage
tests/boundary/process/signalVerifierCleanup.test.tsruns the real verifier as a subprocess undertests/fixtures/signalVerifierPreload.mjs, which authors the Linux guard, the limits read, the fixture root, the MCP owners and the lineage observation throughmodule.registerHooks(the pattern oftests/fixtures/flutterVerifierPreload.mjs). Five cases: an unreadable limits file acquires no root; a connection failure releases the root only afterclient-close,transport-closeandlineage-observe; a refused client close and a refused transport close each still attempt the other owner, keep the root and report the retained path; unverified lineage keeps the root.root-closeafter the owner closes (root released). With this change they stop at the owners or the lineage observation and the root directory remains.Signal recording verification failed; retained fixture root <path> because its cleanup is incomplete.whose cause carries the primary and cleanup failures....verifier) is exercised only by the real lane.Validation performed
npm run test:focused -- tests/boundary/process/signalVerifierCleanup.test.ts— 5 passednpx oxfmt --checkon the three files — clean;npx oxlint— only the pre-existingmax-lines-per-functionwarning for the verifier's operation function (331 lines before, 338 now)Compatibility, safety, and release
real-signal-recording.yml) exercises the success path.Author readiness
Human owner: @abhisheksharma001
Before merge
type(scope): outcome.🤖 Generated with Claude Code