inspector: fix connectToMainThread() abort without parent inspector - #65976
Open
codebytere wants to merge 1 commit into
Open
inspector: fix connectToMainThread() abort without parent inspector#65976codebytere wants to merge 1 commit into
codebytere wants to merge 1 commit into
Conversation
Collaborator
|
Review requested:
|
Collaborator
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65976 +/- ##
==========================================
+ Coverage 89.98% 90.00% +0.02%
==========================================
Files 784 784
Lines 268361 268364 +3
Branches 51117 51110 -7
==========================================
+ Hits 241478 241539 +61
+ Misses 17438 17381 -57
+ Partials 9445 9444 -1
🚀 New features to boost your workflow:
|
`inspector.Session#connectToMainThread()` in a Worker aborted the process on `CHECK_NOT_NULL(parent_handle_)` in `Agent::ConnectToMainThread()` when the parent Environment was created with `kNoCreateInspector`, as embedders that run their own inspector (or none) do. Throw the new `ERR_INSPECTOR_NOT_AVAILABLE` in that case, next to the existing throw for a Worker whose own inspector is not initialized. Refs: nodejs#35025 Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
codebytere
force-pushed
the
fix/embedder-connect-to-main-thread-abort
branch
from
September 11, 2026 19:24
e6399c9 to
a058629
Compare
Collaborator
Collaborator
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.
inspector.Session#connectToMainThread()in a Worker aborts the process when the parent Environment was created withkNoCreateInspector, which is what an embedder that runs its own inspector (or none) passes:Agent::ConnectToMainThread()reachesCHECK_NOT_NULL(parent_handle_)because a parent without an inspector never hands the Worker a parent handle.It now throws
ERR_INSPECTOR_NOT_AVAILABLEin that case, next to the existing throw for a Worker whose own inspector is not initialized; the code is added tonode_errors.hso C++ can raise the errorlibalready uses.Tests:
EnvironmentTest.WorkerConnectToMainThreadWithoutInspectorstarts a Worker under akNoCreateInspectorEnvironment and expects the error code; it aborted before.Refs: #35025
Disclosure: the code, test and this description were written by Claude Code, directed and reviewed by @codebytere.