Skip to content

fix(ext/node): implement timeout and killSignal for spawn()#32283

Merged
fraidev merged 1 commit intodenoland:mainfrom
fraidev:fix/node-child-process-spawn-timeout
Feb 23, 2026
Merged

fix(ext/node): implement timeout and killSignal for spawn()#32283
fraidev merged 1 commit intodenoland:mainfrom
fraidev:fix/node-child-process-spawn-timeout

Conversation

@fraidev
Copy link
Copy Markdown
Contributor

@fraidev fraidev commented Feb 23, 2026

Closes #19517

Fixes the timeout and killSignal options for child_process.spawn() (and fork(), which delegates to spawn()). Previously these options were accepted but silently ignored.

The fix sets a setTimeout after spawning that kills the child with the specified killSignal (default: "SIGTERM") if the process hasn't exited within timeout ms. The timer is cleared if the process exits naturally before the deadline.

Fixes the `timeout` and `killSignal` options for `child_process.spawn()`
(and `fork()`, which delegates to `spawn()`). Previously these options
were accepted but silently ignored.

The fix sets a `setTimeout` after spawning that kills the child with the
specified `killSignal` (default: `"SIGTERM"`) if the process hasn't
exited within `timeout` ms. The timer is cleared if the process exits
naturally before the deadline.
Copy link
Copy Markdown
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix

@fraidev fraidev merged commit 9e7fb63 into denoland:main Feb 23, 2026
110 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node spawn timeout not work

2 participants