Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
cluster: avoid race enabling debugger in worker
Browse files Browse the repository at this point in the history
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 <julien.gilli@joyent.com>
  • Loading branch information
tjfontaine authored and Julien Gilli committed Jan 16, 2015
1 parent 016e084 commit e9df9a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ function masterInit() {
var key;
for (key in cluster.workers) {
var worker = cluster.workers[key];
if (worker.state === 'online') {
if (worker.state === 'online' || worker.state === 'listening') {
process._debugProcess(worker.process.pid);
} else {
worker.once('online', function() {
Expand Down

0 comments on commit e9df9a0

Please sign in to comment.