-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Debugger doesn't work for processes which fork other processes #9435
Comments
/cc @nodejs/v8-inspector |
|
Thanks, that clearer now. Is there a plan to fix it for |
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 Currently we are considering introducing a special "inspector" pipe from Note that this work is in experimental stage and the design will likely On Thu, Nov 17, 2016 at 1:21 PM Bradley Meck [email protected]
|
@eugeneo Should this remain open? |
I believe it can be closed. |
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. |
/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.js |
I'm not mordicus against changing child_process.fork() to be more like cluster.fork(), symmetry is good, but I do think there is a non-zero change it will break third-party code. |
Any chance to have that reopened? |
@medikoo AFAIK GitHub should let you reopen issues you submitted, but in anyway, @eugeneo has set a goal to implement multiplexing multiple inspector "channels" into a single socket connection. This will allow subprocesses to be "inspected" through their parent's socket. Also as mentioned before, in node/lib/internal/cluster/master.js Lines 119 to 122 in bb29405
|
Only if it's me that closed it. Here it's not the case, I'm not able to reopen it. |
Im having this issue now using a library that forks processes, where I have no influence on how the child processes are called. As soon as I use debugging mode, it screws up. Is there an open issue somewhere if we cant reopen this one? |
Hi @bmeck, thank you for the response. An ephemeral port is not portable and configurable so, unfortunately, is not a solution because I should update the port in the IDE's config everytime. PS: I don't think Chrome is suitable for a server side project debugging session 😞 |
@FedericoBiccheddu in a pinch you should be able to use SSH port forwarding to connect your local chrome to a remote (localhost) debug port. I believe with openssh it's |
Hi @vith, thank you for the response. As I said in the previous comment unfortunately is not a solution. Being more specific:
I think the workaround should be limited on the node or docker side. |
"terrible" workaround is not helping me. I am trying to debug Protractor tests, using Webstorm. |
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. |
this problem still exists on node 8.11.3, is there a plan for fixing this? |
@bmeck this is the link to the actual post, right? Chrome DevTools › [for Node] Expand chrome:inspect discovery for debuggable targets |
@CFKevinRef yes, but it looks like Google is working on https://github.com/GoogleChromeLabs/ndb (recently made public) which should supercede that |
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. |
I'm sure once it's fleshed out it will find its way in. But prepending |
@ilijaz Thanks! const options = {
execArgv: []
};
const child = Child.fork(program, options); Although not an ideal fix, this was a great workaround. |
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. |
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. |
I'm running:
Where
some-node-script.js
uses plainchild_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: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
The text was updated successfully, but these errors were encountered: