-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
can --inspect be made to bind debug ports for child processes too? #459
Comments
Another note, this does behave properly when using node directly, like so:
produces:
Which already looks better, since we have two "Debugger listening on..." messages instead of just the one I see with ts-node. Just to be sure, I confirmed via netstat that both ports are bound, and they are. So this seems like a ts-node issue, not a node issue. |
That's interesting. Line 176 in 1d630f9
join(__dirname, 'bin.js') fixes this? The result would basically be having the child process spawn a child node.js process the same way ts-node does.
|
I tried
Basically it seems the child tries to bind to the same port as the parent. |
That's interesting, thanks! It seems to be a tiny bit closer but not enough. Final test, can you try with |
@blakeembrey Yep, |
Awesome news! I'm not sure when I'll get around to hitting this, but I have a decent idea of how I may approach fixing it now. Basically, I'm going to need to refactor to use that command style of spawned command instead and remove the current approach used except in the case of opening the REPL. Thanks for your debugging of the issue 😄 |
FWIW #476 would allow you to start inspect only on the child process. Indeed, Node itself does quite a few things for managing ports, and that behavior might be a tad bit different depending on the version of Node you are using. The only safe and sound thing to do would either to capture flags in a non-node process, pass them to |
This issue is related #471 I get the same error (address already in use) |
I would love to kill the process tree at this point. The main reason it's required is actually for REPL support, but I think it'd be good and/or fine to move toward |
Oh, I was under the impression it was because of v8 flags and general flag parsing/mangling? |
You're right, we do need to proxy through the flags if we expose an executable |
#499 Would solve this issue. |
The |
repro steps (I did this on linux and bash):
This starts a child process using cluster.fork(). Note that debugger listens fine on the master process:
And checking netstat shows that 9229 is indeed bound, which is good.
However, no debugging port is bound for the child process. The output of ps, the
--inspect-port=9230
argument would lead one to believe that a debugger port 9230 is available for the child process:However, this is unfortunately not the case, looking at netstat output:
Can others reproduce this? If so, can this please be addressed so that we can debug child processes properly?
The text was updated successfully, but these errors were encountered: