-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WS connection should not crash with JS bindings session #17085
Conversation
Note that I hope this change (the part about clearer object lifetime) will help debugging the intermittent inspector tests on different platforms. |
ping @bnoordhuis, @addaleax & @TimothyGu — could you have a look at this since a review was requested and this PR has been around for a while? Thanks! @eugeneo would you mind rebasing this if you're still hoping for it to land? |
@apapirovski I rebased the PR. |
Attaching WS session will now include a roundtrip onto the main thread to make sure there is no other session (e.g. JS bindings) This change also required refactoring WS socket implementation to better support scenarios like this. Fixes: #16852 PR-URL: #17085 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Landed as 73ad3f9 Thank you for the reviews. |
Attaching WS session will now include a roundtrip onto the main thread to make sure there is no other session (e.g. JS bindings) This change also required refactoring WS socket implementation to better support scenarios like this. Fixes: #16852 PR-URL: #17085 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Attaching WS session will now include a roundtrip onto the main thread to make sure there is no other session (e.g. JS bindings) This change also required refactoring WS socket implementation to better support scenarios like this. Fixes: #16852 PR-URL: #17085 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Should this be backported to |
I suggest we don't land this on 8.x. This issue is rare so I don't think it is justified to apply this change to the old branch. |
- Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
- Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
inspector, test: reafactor inspector WS socket implementation to be a proper C++
To make it easier to review, I split the change into 2 commits that can be merged after the review.
First commit rewrites WebSockets C API into C++ that allows better management of the object lifecycle. Second implements a change when WS session is not accepted until the session is established on the main thread (this is to ensure there is no current JS bindings session).