summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy J Fontaine <tjfontaine@gmail.com>2015-01-15 23:14:16 +0000
committerJulien Gilli <julien.gilli@joyent.com>2015-01-15 23:41:22 -0800
commite9df9a0216550abab4923bcfc6dea4f4b32368d2 (patch)
tree6a7e788ecc785ec7c51f8898bbebe482495c05b5
parent016e08458cc38d7324c907c6594f2b56a5a19719 (diff)
downloadnode-e9df9a0216550abab4923bcfc6dea4f4b32368d2.tar.gz
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 <julien.gilli@joyent.com>
-rw-r--r--lib/cluster.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/cluster.js b/lib/cluster.js
index c76594ad7..71ebf41c4 100644
--- a/lib/cluster.js
+++ b/lib/cluster.js
@@ -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() {