-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Debug MULTIPLE already running processes (SIGUSR1)... #24085
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
Comments
Not sure if the right people to ping are @nodejs/v8-inspector or @nodejs/diagnostics or someone else? |
Quoting myself from that thread:
The problem is a basic property of unix signals: They don't pass any data. So from the outside there's only "send USR1" which is all On the more complicated side there's things like having a long-running agent that assigns ports or having logic that is able to attach on 9229, assign port, detach, and then reattach. But this assumes fairly smart clients, has a built-in race condition, and breaks as soon as anything actually keeps listening on 9229. |
You can start the inspector race free on a random port with |
@bnoordhuis Yes, but "already running" implies that node was called without any inspect flags set. @jkrems Makes sense about the signals, thanks. That said, |
The issue is that nothing could then ever connect to the port, short of scanning all ports. It really is only useful if you control the process and/or can access its output. And in that case, it feels like you might as well start it with |
We're not changing the default behavior and making non-cooperative processes cooperate is not actionable/reasonable as feature requests go, so I'll go ahead and close this out. You could start node with |
Is there a way to influence (ie change) the inspect port when starting the inspect web socket after runtime? Maybe process._debugProcess(process.pid) would be a good place to start looking/make changes? I've dug around a bit and I'm not sure exactly where to begin in the codebase... C++ or Javascript. My C++ is weak so I'm sure I'm missing a lot in that regard. Some expert help/finger pointing would be great!
My problem currently is coming from the fact that you can only start the inspect process pragmatically on the default port 9229 and that's it. I'd like to be able to start debug web sockets on random ports, such that doing so would be possible on more than a single running Node program.
Another question I had was... is it possible to programmatically shut down the web socket externally just the same but opposite to the way it was started up (ie SIGUSR1)?
Originally posted by @june07 in #8464 (comment)
The text was updated successfully, but these errors were encountered: