-
Notifications
You must be signed in to change notification settings - Fork 283
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
How to close inspector in worker thread? #3651
Comments
@ds3p2 I think the best way to address this would be to always open/close the inspector server from the main thread, and then communicate to the worker threads using that? |
@addaleax |
@ds3p2 I guess you could also use the
I don’t think this is the intended use case here – if you do want to get into a situation in which there can be more than one built-in inspector TCP server per process, I think that would require some work on Node.js itself. |
I do not quite understand your suggestion. In the main process I cannot call
I am not sure if I understand this correctly. Are you suggesting that |
Yes.
I don’t know? |
@addaleax |
@ds3p2 No, but I assume there should be one in https://nodejs.org/api/inspector.html#inspectoropenport-host-wait. It’s a bit unfortunate that the inspector API was never really well-documented to begin with 😕 |
@addaleax |
Details
I am trying to enable some debugging in the worker thread programmatically. I read the Inspector API and trying to implement it in the worker thread model.
Currently I am not sure which is the proper way to use the
inspector
module in worker thread.The sample code shows how I am using
inspector
.inspector.open
can be called in the worker thread, and the created inspector only works in the current thread. Breakpoints in other thread / main thread will be just ignored.inspector.close
isundefined
in worker thread. According to fix(worker): allow inspector.close() inside Worker node#30680, this is the expected behavior. But the question is how do I close the debugger port created in the worker thread?Node.js version
14.15.5
Example code
Operating system
Mac OS 12.0.1
Scope
code, runtime
Module and version
Not applicable.
The text was updated successfully, but these errors were encountered: