cluster: properly handle --inspect-{brk,port}

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Ali Ijaz Sheikh 2017-02-14 13:24:37 -08:00 committed by James M Snell
parent c090ca8160
commit 389b9e484d
2 changed files with 3 additions and 1 deletions

View File

@ -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) {

View File

@ -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);