fix(ext/node): fix worker.terminate() return value and exit code#32168
Merged
bartlomieju merged 6 commits intodenoland:mainfrom Feb 15, 2026
Merged
fix(ext/node): fix worker.terminate() return value and exit code#32168bartlomieju merged 6 commits intodenoland:mainfrom
bartlomieju merged 6 commits intodenoland:mainfrom
Conversation
In Node.js, calling worker.terminate() after the worker has already exited resolves to undefined (the internal handle is null). Previously Deno always resolved to 0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tion Node.js uses exit code 1 when a worker is forcefully terminated via worker.terminate(). Previously Deno always used exit code 0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b1c0cda to
a51fa04
Compare
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
Two fixes to
worker.terminate()behavior to match Node.js:undefinedwhen worker already exited: In Node.js, callingworker.terminate()after the worker has already exited resolves toundefined(the internal handle is null). Previously Deno always resolved to0.1for forced termination: Node.js uses exit code1when a running worker is forcefully terminated viaworker.terminate(). Previously Deno always used0.Enables 2 new node_compat tests:
test-worker-terminate-null-handler.jstest-worker-terminate-microtask-loop.jsTest plan
cargo test --test node_compat parallel -- --filter "test-worker-terminate"— all registered tests passtest-worker-dispose.mjsor other tests callingterminate()🤖 Generated with Claude Code