Preserve signal zero with descendant termination - #1
Conversation
Exact-head review —
|
teamleaderleo
left a comment
There was a problem hiding this comment.
Exact-head review — dc73ffcd1765666f77fb39775af73abec08c5bb5
Disposition: ACCEPT the owned-fork implementation candidate; HOLD upstream promotion pending a separate authorization decision.
Evidence class: target-executed for the focused six-job Ubuntu/Windows matrix. This is not a full repository gate.
The complete three-file diff is appropriately narrow:
- signal
0is handled in the shared descendant-kill dispatcher before either platform adapter is selected; - the native
ChildProcess.kill(0)liveness contract remains authoritative; - all non-zero signals retain the existing Unix process-group or Windows
taskkill /T /Fpath; - the live process-tree test proves the direct child and descendant remain alive after signal
0and still terminate under a normal kill; - the delayed-force-kill test proves
forceKillAfterDelaydoes not convert the liveness check into later termination; - the Windows adapter control proves
taskkillis not invoked for signal0.
I found no missing error-preservation, adapter-selection, or cleanup blocker in this scope. The central guard is better than the earlier Windows-only version because killDescendants should alter termination delivery, not redefine signal-zero semantics by platform.
Remaining boundary:
- retain the exact focused matrix receipt and avoid calling it
full-gate; - refresh duplicate/prior-art search at the then-current upstream head before any packet is prepared;
- keep upstream contact unauthorized until a specific submission is reviewed.
No additional implementation work is required for the stated candidate.
In simple words
Execa supports
subprocess.kill(0)as a non-destructive process-existence check. WithkillDescendants: true, the Windows implementation routes termination through forcedtaskkill /T /F, which previously could turn that liveness check into process-tree termination.This draft handles signal
0before selecting any platform-specific descendant-termination adapter. Non-zero signals continue to terminate the process tree.Changes
0through the native child-process liveness check on every platform;taskkillis not called;kill(0);forceKillAfterDelaydoes not later terminate the tree;Self-review correction
The first revision handled signal
0only inside the Windows adapter. Review moved the guard into the shared dispatcher so the contract is explicit and platform-independent:killDescendantschanges termination behavior, not liveness-check semantics.Validation
Fieldwork workflow
30491600304checked out this exact branch and ran the focused repository tests on:All six jobs passed. The Windows jobs used a real hosted Windows runner and the real
taskkill.exepath.Additional local source execution on Node 22.16.0 confirmed:
0called the native child check and launched notaskkill;SIGTERMlaunched the expected/T /Fcommand;0, then terminated both for a normal signal.Prior-art check
No matching current Execa issue or pull request was found. The closest precedent is merged PR sindresorhus#1258, which deliberately routes Windows descendant termination through
taskkilland falls back to the requested signal only whentaskkillis unavailable or fails. That path did not special-case the non-terminating signal0.Research boundary
This is owned-fork Fieldwork research. It is not intended for upstream submission without separate authorization.