Skip to content

Commit 4dd22b9

Browse files
tjfontainebnoordhuis
authored andcommitted
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: nodejs#6440 Original-PR-URL: nodejs#9037 Signed-off-by: Julien Gilli <[email protected]> Fixes: nodejs/node#340 PR-URL: nodejs/node#501 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Bert Belder <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
1 parent 6b91c78 commit 4dd22b9

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
@@ -266,7 +266,7 @@ function masterInit() {
266266
var key;
267267
for (key in cluster.workers) {
268268
var worker = cluster.workers[key];
269-
if (worker.state === 'online') {
269+
if (worker.state === 'online' || worker.state === 'listening') {
270270
process._debugProcess(worker.process.pid);
271271
} else {
272272
worker.once('online', function() {

0 commit comments

Comments
 (0)