fix(ext/node): handle signal 0 in child_process.kill()#32294
Merged
bartlomieju merged 5 commits intodenoland:mainfrom Mar 11, 2026
Merged
fix(ext/node): handle signal 0 in child_process.kill()#32294bartlomieju merged 5 commits intodenoland:mainfrom
bartlomieju merged 5 commits intodenoland:mainfrom
Conversation
In POSIX, signal 0 is used to check if a process exists without actually sending a signal. Deno's `toDenoSignal` didn't recognize signal 0, causing `child.kill(0)` to throw `Unknown signal: 0`. This broke npm packages like nuxt that use `kill(0)` to check if a child process is still alive on exit. Closes denoland#25776 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes resource leak on Windows where the child process wasn't fully closed before the test ended, causing cascading failures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kajukitli
approved these changes
Mar 10, 2026
Contributor
kajukitli
left a comment
There was a problem hiding this comment.
lgtm — signal 0 is a POSIX special case for checking process existence
delegates to process.kill(pid, 0) which already handles this correctly. returns true if process exists, false otherwise. doesn't set killed flag since no signal was actually sent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
child_process.kill(0)threwUnknown signal: 0becausetoDenoSignal()didn't recognize signal 0kill(pid, 0))0(both numeric and string"0") as a special case inChildProcess.kill(), usingprocess.kill(pid, 0)which already supports signal 0nuxtthat usekill(0)to check if a child process is alive on exitCloses #25776
Test plan
killSignalZeroinchild_process_test.tscargo test unit_node::child_process_testpasses🤖 Generated with Claude Code