Skip to content

Commit e9df9a0

Browse files
tjfontaineJulien Gilli
authored and
Julien Gilli
committed
cluster: avoid race enabling debugger in worker
Previously if a worker's state machine had already transitioned into the 'listening' state when it received the message enabling the debugger, the worker would never enable its debugger. Change the logic to allow the 'listening' as a valid state for enabling the debugger. Fixes #6440 Signed-off-by: Julien Gilli <[email protected]>
1 parent 016e084 commit e9df9a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/cluster.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ function masterInit() {
285285
var key;
286286
for (key in cluster.workers) {
287287
var worker = cluster.workers[key];
288-
if (worker.state === 'online') {
288+
if (worker.state === 'online' || worker.state === 'listening') {
289289
process._debugProcess(worker.process.pid);
290290
} else {
291291
worker.once('online', function() {

0 commit comments

Comments
 (0)