summaryrefslogtreecommitdiff
path: root/lib/internal/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal/cluster')
-rw-r--r--lib/internal/cluster/master.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/internal/cluster/master.js b/lib/internal/cluster/master.js
index 570cf7bc6f..3c6a398f11 100644
--- a/lib/internal/cluster/master.js
+++ b/lib/internal/cluster/master.js
@@ -14,6 +14,7 @@ const intercom = new EventEmitter();
const SCHED_NONE = 1;
const SCHED_RR = 2;
const { isLegalPort } = require('internal/net');
+const [ minPort, maxPort ] = [ 1024, 65535 ];
module.exports = cluster;
@@ -119,6 +120,8 @@ function createWorkerProcess(id, env) {
}
} else {
inspectPort = process.debugPort + debugPortOffset;
+ if (inspectPort > maxPort)
+ inspectPort = inspectPort - maxPort + minPort - 1;
debugPortOffset++;
}