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
--inspect flag and cluster module - Debug port numbers not incrementing #8201
When using the --debug=6000 flag with the cluster module, the first debug port 6000 would be assigned to the cluster master, then the first worker would be assigned to 6001, then the second worker would be assigned to 6002, etc...
However, when using the new --inspect=6000 flag with the cluster module, the cluster master process is assigned 6000 (which is correct) but the first worker is assigned 5859 (instead of the expected 6001), second worker is 5860 (instead of 6002), etc...
So this prevents us from changing the default debug ports for workers forked using the cluster module.
I tried messing with the settings on the cluster module by passing custom execArgv options such as: cluster.setupMaster({execArgv: ["--inspect=6001"]}) (I tried a few variations) but it doesn't appear to work.
if you use vs code to debug, you need to specify port and and "autoAttachChildProcesses": true in lanuch.json file. if you debug directly in DevTool ,you need to add a connection to corresponding port that in console.
Activity
bnoordhuis commentedon Aug 21, 2016
That is because the cluster module currently uses
process.debugPortas the base, which is not the port that the inspector uses.You can use
--debug-port=6000 --inspect=6000(in that order) as a workaround for now.inspector: listen on process.debugPort
inspector: restore 9229 as a default port
test: add cluster inspector debug port test
test: add cluster inspector debug port test
x343734282 commentedon Sep 1, 2019
if you use vs code to debug, you need to specify port and and "autoAttachChildProcesses": true in lanuch.json file. if you debug directly in DevTool ,you need to add a connection to corresponding port that in console.
https://stackoverflow.com/questions/9691554/debugging-node-js-processes-with-cluster-fork/57743288#57743288