You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Debugger doesn't work for processes which fork other processes #9435
Where some-node-script.js uses plain child_process.fork (run with defaults mostly) calls to initialize few other processes internally. Right after that I receive message Unable to open devtools socket: address already in use:
$ node -v
v7.0.0
$ node --inspect some-node-script.js
Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost:9229/edbce9e9-0a9d-4c24-8f2b-bcaaeb4a5965
Unable to open devtools socket: address already in use
Also forked process crashes so technically application doesn't run (I've skipped that part of a log to avoid not related noise).
Behavior is same in both latest Node.js v7 and v6 (Tested on OSX, both El Captain and Sierra, with latest Chrome on board)
Am I doing something wrong, or there's no support currently for multi-process Node.js apps?
I've found similar issue which states that this probably should just work, but gives no clue why it actually doesn't.
I'll be happy to provide simple test case if needed
with v8 landing RemoteExecutionContext, it should be possible for a debugger to work for multiple processes. I don't know if we are ready for that and it requires v8 version >=55 which isn't going to land on Node v6
V8 inspector protocol has support for the "subtargets" - we are currently
looking into leveraging that for the node processes that fork children. #9630 updates the HTTP transport for the
inspector, now it should be able to track multiple "sessions" and also list
multiple targets.
Currently we are considering introducing a special "inspector" pipe from
the parent to a child so the child does not have to run the HTTP server.
All communications with the children will happen through the parent, parent
will also be able to list individual children.
Note that this work is in experimental stage and the design will likely
change a lot.
with v8 landing RemoteExecutionContext, it should be possible for a
debugger to work for multiple processes. I don't know if we are ready for
that and it requires v8 version >=55 which isn't going to land on Node v6
—
You are receiving this because you are on a team that was mentioned.
Multi-process Node.js configurations are not that uncommon, and currently debugger functionality is not usable having such setup. I see it as quite important issue.
Reacted by Harry Weppner, Frank Chiang, Lucas Viñals, nilssolanki, Jason Papakostas, Qiong Wu, Vilkov Timur, Dmitrii Sorin, Norman Breau, Markus Tretzmüller and 21 more
/ping @bnoordhuis Is the reasoning in #8495 (comment) basically an explanation of why the behavior observed here is the way it is, and why it is unlikely to be changed?
@medikoo Does it work in Node.js 8.x if you invoke the script like this?:
I've opened https://groups.google.com/forum/#!forum/google-chrome-developer-tools to start discussion on things, but all these non-chrome approaches such as IDEs would need to adopt any solution that would be agreed upon if the feature is seen as safe/valuable enough to implement.
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.
Activity
mscdex commentedon Nov 3, 2016
/cc @nodejs/v8-inspector
bnoordhuis commentedon Nov 3, 2016
child_process.fork()doesn't fix up execArgv, onlycluster.fork()does. See #8495 (comment).medikoo commentedon Nov 3, 2016
Thanks, that clearer now. Is there a plan to fix it for
child_process.fork?medikoo commentedon Nov 3, 2016
After reading this comment I see that probably #5025 is meant to fix this issue
bmeck commentedon Nov 17, 2016
with v8 landing RemoteExecutionContext, it should be possible for a debugger to work for multiple processes. I don't know if we are ready for that and it requires v8 version >=55 which isn't going to land on Node v6
eugeneo commentedon Nov 17, 2016
V8 inspector protocol has support for the "subtargets" - we are currently
looking into leveraging that for the node processes that fork children.
#9630 updates the HTTP transport for the
inspector, now it should be able to track multiple "sessions" and also list
multiple targets.
Currently we are considering introducing a special "inspector" pipe from
the parent to a child so the child does not have to run the HTTP server.
All communications with the children will happen through the parent, parent
will also be able to list individual children.
Note that this work is in experimental stage and the design will likely
change a lot.
On Thu, Nov 17, 2016 at 1:21 PM Bradley Meck notifications@github.com
wrote:
Trott commentedon Jul 15, 2017
@eugeneo Should this remain open?
eugeneo commentedon Jul 17, 2017
I believe it can be closed.
medikoo commentedon Jul 17, 2017
Does it mean, there's no plan to fix it?
Multi-process Node.js configurations are not that uncommon, and currently debugger functionality is not usable having such setup. I see it as quite important issue.
Trott commentedon Jul 18, 2017
/ping @bnoordhuis Is the reasoning in #8495 (comment) basically an explanation of why the behavior observed here is the way it is, and why it is unlikely to be changed?
@medikoo Does it work in Node.js 8.x if you invoke the script like this?:
$ node --inspect --inspect-port=0 some-node-script.js21 remaining items
bmeck commentedon Jul 2, 2018
I've opened https://groups.google.com/forum/#!forum/google-chrome-developer-tools to start discussion on things, but all these non-chrome approaches such as IDEs would need to adopt any solution that would be agreed upon if the feature is seen as safe/valuable enough to implement.
eason-shsf commentedon Jul 4, 2018
this problem still exists on node 8.11.3, is there a plan for fixing this?
CFKevinRef commentedon Jul 30, 2018
@bmeck this is the link to the actual post, right?
Chrome DevTools › [for Node] Expand chrome:inspect discovery for debuggable targets
bmeck commentedon Jul 30, 2018
@CFKevinRef yes, but it looks like Google is working on https://github.com/GoogleChromeLabs/ndb (recently made public) which should supercede that
CADBOT commentedon Aug 21, 2018
Even if it works in ndb, it would be great to have in the command line debugger. I'm a huge fan of it as it involves less context switching.
trusktr commentedon Sep 4, 2018
I'm sure once it's fleshed out it will find its way in. But prepending
ndbto any command is so easy!👍mdrichardson commentedon Dec 18, 2019
@ilijaz Thanks!
Although not an ideal fix, this was a great workaround.
github-actions commentedon Mar 4, 2022
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
github-actions commentedon Apr 4, 2022
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.
For more information on how the project manages feature requests, please consult the feature request management document.