Skip to content

Commit bf22dc4

Browse files
committed
Correct nodejs/node#43704's status - it is closed, not open
The prior commit's disclosed-limit paragraph called the upstream nodejs/node#43704 report "still open." It is not: the issue is closed, reason not planned, since 2023-03-27. It remains citable for the mechanism it documents - a child_process timeout's SIGTERM reaches only the immediate child, never a grandchild it spawned - but the status claim itself was false, and it was false in the exact prose that cites it. Fixed in both the code comment and the CHANGELOG entry. Nothing else about the disclosed limit changes: if the underlying loader-escape-matrix stranding is a genuinely permanent hang rather than a slow-but-completing one, the 180-second raise still does not fix it - a genuinely permanent hang is still caught, just 120 seconds later than before.
1 parent be8c0cb commit bf22dc4

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ All notable changes to this project are documented in this file.
8787
- Bumped the pinned MCP SDK (`@modelcontextprotocol/server`, `@modelcontextprotocol/client`, and the transitive `core` package) from `2.0.0-beta.5` to the released `2.0.0` GA version. The Tasks-related export set the module-loader guard enumerates by hand is unchanged between the two versions, confirmed by a direct diff of the installed declaration file.
8888
- The Tasks-extension wake now fires on stderr output the same way it already did on stdout, instead of ignoring stderr entirely: a command that reports progress only on stderr (many build and test tools do) no longer leaves a capable client waiting silently until the job exits. A wake batch carries a `stdout` key, a `stderr` key, or both, each present only when that stream actually produced a line in the window being flushed - never an empty array for a stream with nothing new to report. Firehose detection now counts lines from both streams together, so a stream dumping output at firehose rate on stderr trips the same auto-stop guard stdout already had. `status`/`output`/`tail` are unchanged by this; the wake is only ever an accelerator on top of the same poll floor.
8989
- `run` can now be scoped to an operator-configured set of allowed working directories via a new `GHANTIKA_CWD_ROOTS` environment variable (a `path.delimiter`-separated list, unset by default, matching the pre-existing behavior of allowing any accessible directory). Unset, or the raw value itself being empty, is the only shape meaning no restriction; any other raw value is a configuration attempt and denies every cwd unless it resolves to at least one effective root - including a value that splits and filters down to zero entries, which denies every cwd rather than being silently read back as unrestricted. A candidate `cwd` is compared against each configured root by its real, symlink-resolved target - never a literal string prefix - so a directory named only through a symlink (either the candidate itself, or the configured root) is judged by where it actually points, and a sibling directory whose name merely starts with a root's name is correctly rejected rather than matched. A root that cannot itself be resolved is silently dropped from the effective set rather than crashing the check or being treated as a wildcard. Disclosed time-of-check-to-time-of-use residual, and the gap is not narrow on either path: the real path is validated once, at the moment of the call, before `run()`'s own concurrency admission. A free slot removes only the queue-duration extension of that gap, not the gap itself - env construction, executable resolution (an unbounded walk of a caller-suppliable PATH), policy resolution, and job-record creation all still sit between validation and spawn even when a slot is immediately free. A job that queues instead of spawning immediately holds that same resolved string, unrevalidated, for its entire time in the queue - arbitrarily long, bounded only by the jobs ahead of it - and the OS itself re-resolves the pathname independently at the moment it actually spawns regardless of which path a job took, so a symlink swap or directory replacement any time before that moment is not something this closes on either path; proven by a real queued-job reproduction that swaps a validated directory for an escaping symlink while a job sits queued. Two things this change explicitly does not claim: it never inspects or filters what a spawned child chooses to write to its own stdout, and it adds no isolation between a job's environment and this server's own internal state or a genuinely external same-uid OS process inspection of the real spawned child - both remain exactly as visible to an operator as before, proven here by dedicated negative-control tests (including a real `ps`-based external inspection of a live child's own environment) rather than left as an unverified sentence in a doc comment.
90-
- Raised `scripts/run-tests.mjs`'s idle-watchdog ceiling from 60 to 180 seconds. `test/loader-escape-matrix.test.ts`'s own `before()` hook blocks synchronously on a nested `node --test` supervisor bounded by its own 45-second timeout, and while that call is in flight this repo's test wrapper sees no event of any kind - under coverage (single concurrent file), nothing else is running to paper over the silence either. Measured directly: instrumenting the wrapper's own event handler and running the full coverage suite end to end on this machine put the worst observed gap at 40.8 seconds, landing immediately before that same file - and two independent hosted-CI runs (ubuntu-24.04, node 22) each showed the full 60-second ceiling elapse in total silence at that identical point, a lower bound on the real CI-side gap since the watchdog fires and the process exits exactly there. 180 seconds gives roughly 4x the measured local worst case and 3x the nested supervisor's own already-configured bound - real headroom for that recovery mechanism to finish under real CI scheduling latency before this wrapper's patience runs out from underneath it. Disclosed limit: if the underlying stranding is a genuinely permanent hang rather than a slow-but-completing one - consistent with the still-open upstream report that a child_process timeout's SIGTERM reaches only the immediate child, never a grandchild it spawned (nodejs/node#43704) - this does not fix that; a genuinely permanent hang is still caught, just 120 seconds later than before, and that added latency is the real cost of this change. A new negative control proves the watchdog mechanism itself still fires and names the stuck file at whatever ceiling is configured, driven at a short value chosen for the control's own speed rather than the full 180 seconds, which would prove nothing more while taking three minutes to run.
90+
- Raised `scripts/run-tests.mjs`'s idle-watchdog ceiling from 60 to 180 seconds. `test/loader-escape-matrix.test.ts`'s own `before()` hook blocks synchronously on a nested `node --test` supervisor bounded by its own 45-second timeout, and while that call is in flight this repo's test wrapper sees no event of any kind - under coverage (single concurrent file), nothing else is running to paper over the silence either. Measured directly: instrumenting the wrapper's own event handler and running the full coverage suite end to end on this machine put the worst observed gap at 40.8 seconds, landing immediately before that same file - and two independent hosted-CI runs (ubuntu-24.04, node 22) each showed the full 60-second ceiling elapse in total silence at that identical point, a lower bound on the real CI-side gap since the watchdog fires and the process exits exactly there. 180 seconds gives roughly 4x the measured local worst case and 3x the nested supervisor's own already-configured bound - real headroom for that recovery mechanism to finish under real CI scheduling latency before this wrapper's patience runs out from underneath it. Disclosed limit: if the underlying stranding is a genuinely permanent hang rather than a slow-but-completing one - consistent with an upstream report (nodejs/node#43704, closed as not planned in 2023, cited here for the mechanism it documents) that a child_process timeout's SIGTERM reaches only the immediate child, never a grandchild it spawned - this does not fix that; a genuinely permanent hang is still caught, just 120 seconds later than before, and that added latency is the real cost of this change. A new negative control proves the watchdog mechanism itself still fires and names the stuck file at whatever ceiling is configured, driven at a short value chosen for the control's own speed rather than the full 180 seconds, which would prove nothing more while taking three minutes to run.

‎scripts/run-tests.mjs‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,15 @@ export function parseArgs(argv) {
269269
//
270270
// Disclosed limit, not solved by this change: if the underlying
271271
// stranding is a genuinely PERMANENT hang rather than a slow-but-
272-
// completing one - consistent with the still-open upstream report
273-
// that a child_process timeout's SIGTERM reaches only the immediate
274-
// child, never a grandchild it spawned (nodejs/node#43704) - this
275-
// raise does not fix that. It only stops killing a run that was
276-
// legitimately still finishing its own already-configured recovery;
277-
// a genuinely permanent hang is still caught, just 120s later than
278-
// before, and that added latency is the real, honest cost of this
279-
// change.
272+
// completing one - consistent with an upstream report (nodejs/node#43704,
273+
// closed as not_planned in 2023, cited here for the mechanism it
274+
// documents, not as an open issue) that a child_process timeout's
275+
// SIGTERM reaches only the immediate child, never a grandchild it
276+
// spawned - this raise does not fix that. It only stops killing a
277+
// run that was legitimately still finishing its own already-configured
278+
// recovery; a genuinely permanent hang is still caught, just 120s
279+
// later than before, and that added latency is the real, honest cost
280+
// of this change.
280281
idleTimeoutMs: 180_000,
281282
// Backstop for the whole run regardless of how the time is spent -
282283
// catches a death by a thousand near-idle-but-not-quite-idle cuts

0 commit comments

Comments
 (0)