deno
43deeb2c - fix(ext/node): implement timeout, killSignal, and pid for child_process spawnSync (#32810)

Commit
105 days ago
fix(ext/node): implement timeout, killSignal, and pid for child_process spawnSync (#32810) ## Summary - Implements `timeout` and `killSignal` options for `spawnSync`/`execSync`/`execFileSync` - Spawns a condvar-based timer thread that kills the child process (and its process group on Unix) after the deadline, then flags `killed_by_timeout` in the result - Returns `pid` from `op_spawn_sync` so `spawnSync` results include the `pid` field as Node.js expects - Uses a `KillSignal` enum to accept both numeric and string signal values directly from JS, avoiding string roundtrip - On Unix, uses `process_group(0)` + `kill(-pgid)` to kill the entire process tree on timeout - On Windows, uses `OpenProcess`/`TerminateProcess` with a brief pipe-reader timeout for orphaned grandchildren - `pid` and `killed_by_timeout` are exposed as non-enumerable properties on the output object, keeping the `Deno.Command` public API unchanged --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Parents
Loading