Repository navigation
test(provision): record owned-group TERM from a wait(2) supervisor (#14927) - #14934
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Exact-head Linux review of |
|
The unchanged exact-head Linux fixture also failed a loaded repetition, separately from the scratch oracle mutation above. I verified fixture blob Follow-up with the same command and contention: eight additional runs each selected all three cases and passed. Totals for this bounded sample are 8/9 runs all green, deadline case 8/9, each explicit cancellation case 9/9. The missing marker was intermittent, not reproducible on every iteration; the requested 50 consecutive clean loaded runs have not been shown. |
EffortlessSteven
left a comment
There was a problem hiding this comment.
VERDICT: APPROVE 262a227 — no blocking findings on this head.
Source verdict for head 262a2277d6fa34c6b86425c646de1d3a7e577731, base 77ac5a24, effective merge base against origin/main 6bad9f4f = 77ac5a24.
Claim match. The delta in the body holds as written: TERM_SUPERVISOR_SCRIPT sets trap 'printf observed > "$term"' TERM, publishes $term.ready, then backgrounds the role and blocks in wait. makeProcessFixture wraps both roles — the outer one as the nativeRun command (/bin/sh supervisor parent.term node program …) and the descendant through process.argv[5] in ownedProcessMain — so parent.term and descendant.term are no longer written by the Node SIGTERM handler. cancelProcessFixture now gates cancellation on both .term.ready files and waits on a bounded condition for both acknowledgements (4000 ms) instead of sampling once. The fixture still installs a TERM handler, so it stays TERM-resistant and the forced-cleanup path is still exercised; status 143 and the terminal-state assertions are untouched. tools/provision-dev.cjs is untouched.
Discriminating evidence I could run. No Linux host here either, so I exercised the committed supervisor script directly under POSIX sh (Git for Windows sh) with a TERM-resistant child: readiness is published before the child's first pulse, the acknowledgement is written while the supervisor is blocked in wait(2), the supervisor survives the TERM, and the child keeps advancing after the acknowledgement. That is the mechanism the PR claims, and it is not something the old Node-handler form could do under event-loop starvation. The wiring (argument positions, $term before shift, "$@" &, both term-file paths, the argv[5] supervisor handoff) I traced by reading the two files; every path matches.
Group delivery is unchanged. The old assertion already required the descendant Node process to write its own .term, and those subtests pass on Linux, so the TERM nativeRun/timeout delivers does reach the whole owned group. The sup ervisors are both members of that group, so both traps fire.
Non-blocking, named.
- The acknowledgement's subject changed: it now proves the supervisor — and therefore the group — was signalled, not that the fixture role process itself was. A point-to-point TERM to the supervisor alone would now satisfy the ack while the fixture never saw it. The fixture-side guarantee still rides on
terminalState(descendant).terminal === falsebefore cancellation andterminal === truefor both roles afternativeRun, so the suite still fails on a leaked descendant; only the sentence in the body ("a child that never receives TERM fails the acknowledgement check") is imprecise under the new code. - Residual load risk, not a defect: between the group TERM and
--kill-after=150msthe shell still has to be scheduled to run the trap. That window is far safer than a Node event loop but not infinite; this is what the issue's stress acceptance is for.
Qualification the head still lacks. No Rust lane has run on 262a2277: the only check-runs present are GitGuardian, Graphite mergeability and CodeRabbit, and mergeStateStatus is BLOCKED. The two modified subtests are skip: !NATIVE, so they are Linux-only and have not executed anywhere yet — not on the author's host and not in CI at this head. The governing issue's acceptance ("50+ consecutive local passes under CPU load, plus a negative control in which a leaked descendant still fails") is explicitly listed as pending in the body; the 50/50 in the body is the standalone supervisor harness, not the two cancellation subtests. Shard 3 of the merge group is the first real execution of this code, and the fix's whole purpose is determinism under load, so one green run is a weak sample even though it is the strongest one available pre-merge.
Not checked. No local Node or Linux run of tools/provision-dev.test.cjs; no execution of nativeRun, timeout group delivery, or the two modified subtests. I read the committed blobs and ran the supervisor script alone.
|
Disposition: acceptance proof dispatched to coding ripr-swarm at The source review is APPROVE, but the PR does not meet #14927's acceptance yet, and I am not accepting one green run as sufficient for a determinism fix. Both modified subtests are The proof required: 50+ passes under CPU load with the modified subtests actually executing, plus the leaked-descendant negative control. The PR is not enqueued until that proof is in. |
|
Small correction to the proof handoff: the full fixture’s three focused cases did execute on Linux in scratch at the exact |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Exact-head review of #14934 at 262a227.
Identity. Two files, +60/-8: tools/provision-dev.test.cjs and the changelog. The head is one commit on 77ac5a2435; git merge-tree against current main is clean.
The acknowledgement no longer depends on the supervised event loop. The new TERM_SUPERVISOR_SCRIPT sets a trap that writes observed to the role's .term file, publishes .term.ready before starting the child, and then blocks in wait(2) on the child. The fixture's Node SIGTERM handler no longer writes .term; it only keeps the process TERM-resistant. The parent role starts the descendant through the same supervisor, so both roles have a supervisor blocked in wait(2).
The test now waits for the handshake, not a live process table. observe requires .term.ready before .term, and cancelProcessFixture waits for both .term files after SIGTERM with a 4000 ms bound. The nativeRun invocation is /bin/sh with the supervisor, so the group TERM reaches the supervisor's trap even when the Node event loop is starved.
Caveat, as requested: the fixture needs Linux /proc and /bin/sh; this box is Windows, so I did not run it. The evidence is the hosted lane, and I did not ask for one. The PR is unlabelled and unqueued; I did not arm it.
Not checked: no local run of tools/provision-dev.test.cjs; the hosted lane is the evidence.
|
Acceptance proof: 50/50 loaded passes at Run 44471043167 (workflow-only head
Negative controls (throwaway branch, three separate mutations, each must fail):
The first mutation alone would not have been enough: it trips the fixture's own group-membership guard before the termination assertion. The second and third reach the assertions that matter, and the third isolates the descendant specifically. Proof PR #15174 is throwaway and is being closed; both proof branches are deleted. |
Fixes #14927.
Source-of-truth Links
Proposal: none
Spec: none
ADR: none
Plan item: none
Governing issue or accepted claim: #14927 - flake(ci): provision-dev subtest 40 fails shard 3 intermittently and drops PRs from the merge queue
Acceptance delta (one sentence): Each owned fixture process records the group TERM from a small sh supervisor blocked in wait(2), so the acknowledgement no longer depends on the Node event loop surviving the kill grace.
Problem
tools/provision-dev.test.cjssubtests 40 and 41 assert that each owned processobserved the group TERM by reading a
.termfile that the fixture's NodeSIGTERM handler wrote.
nativeRunescalates withtimeout --kill-after=150ms,so on a loaded runner the handler could be starved past the grace, the process
was SIGKILLed, and the file never appeared - even though the group had received
the signal and every owned process ended terminal. That is the shard-3 failure
(
parent did not observe the owned group TERM) that removed PRs from the mergequeue.
Fix
The acknowledgement no longer depends on the supervised process's event loop:
shsupervisor starts each fixture role, armstrap 'printf observed > "$term"' TERMand then blocks in
wait(2). A blocked supervisor runs the trap as soon asthe group is signalled, so CPU starvation of Node cannot drop the record.
<role>.term.readybefore it starts the child, andcancelProcessFixturenow waits for both readiness files before cancelling,so the handshake is armed before the signal.
acknowledgements instead of sampling a live table once.
forced-cleanup path is exercised), and the assertions are unchanged: the TERM
acknowledgement must exist,
statusmust be 143, and every owned process mustbe terminal after
nativeRunreturns.tools/provision-dev.cjsis untouched; the Rust wrapper does not need a changebecause it only invokes this file.
Evidence
node --check tools/provision-dev.test.cjspasses.node --test tools/provision-dev.test.cjs(Windows host): 4 pass, 0 fail,37 skip - the native process subtests are
skip: !NATIVE(Linux-only), so nolocal Linux execution is possible on this host (no WSL/Docker).
sh: readiness file ispublished, the TERM acknowledgement is written while the supervisor is blocked
in
waitand the TERM-resistant child is still alive, 50/50 consecutive runspassed. Negative control of the same harness (a child that never receives
TERM) fails the acknowledgement check.
taskset -c 0 node --test tools/provision-dev.test.cjswith two CPU burners pinned to the same core: 50/50 full-fixture passes, 0 run logs containing anot okline, and cases 39, 40 and 41 each 50 ok / 0 not ok. With the earlier 25/25 from run 44463060606 that is 75 loaded passes at262a2277, 0 failures. The five shard jobs read red only because the per-casegrep "^not ok N"runs underbash -eand a zero match aborts the step after it printed the summary; the uploadedrun-*.logartifacts are the evidence.detached: trueon the counterexample spawn -> "the counterexample must stay in the command process group";signalGroup('SIGKILL')disabled -> "parent remains live after nativeRun returned";process.kill(child.pid)instead of-child.pid-> "the descendant heartbeat continued after nativeRun returned".process.exit(0)in a scratch copy still passed, so that premise is not separately observed on this head.No label and no queue action; that transition belongs to the queue owner.