Skip to content

Commit

Permalink
cluster: properly handle --inspect-{brk,port}
Browse files Browse the repository at this point in the history
PR-URL: #11386
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
ofrobots authored and addaleax committed Feb 22, 2017
1 parent da10e26 commit 4b4bc13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/cluster/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function createWorkerProcess(id, env) {

for (var i = 0; i < execArgv.length; i++) {
const match = execArgv[i].match(
/^(--inspect|--debug|--debug-(brk|port))(=\d+)?$/
/^(--inspect|--inspect-(brk|port)|--debug|--debug-(brk|port))(=\d+)?$/
);

if (match) {
Expand Down
2 changes: 2 additions & 0 deletions test/parallel/test-cluster-inspector-debug-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ if (cluster.isMaster) {
fork(4, ['--inspect', '--debug']);
fork(5, [`--debug=${debuggerPort}`, '--inspect']);
fork(6, ['--inspect', `--debug-port=${debuggerPort}`]);
fork(7, [`--inspect-port=${debuggerPort}`]);
fork(8, ['--inspect', `--inspect-port=${debuggerPort}`]);
} else {
const hasDebugArg = process.execArgv.some(function(arg) {
return /inspect/.test(arg);
Expand Down

0 comments on commit 4b4bc13

Please sign in to comment.