diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2015-01-15 23:14:16 +0000 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-01-19 19:31:01 +0100 |
commit | 4dd22b946ebfec81a7c4a61aa9c6ed528e317802 (patch) | |
tree | 01f758817ac72ad85c60f54b1bfc38883a90c94a /lib | |
parent | 6b91c78e201948937a4524027a6778aa7f82fb0a (diff) | |
download | node-new-4dd22b946ebfec81a7c4a61aa9c6ed528e317802.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: https://github.com/joyent/node/issues/6440
Original-PR-URL: https://github.com/joyent/node/pull/9037
Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
Fixes: https://github.com/iojs/io.js/issues/340
PR-URL: https://github.com/iojs/io.js/pull/501
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cluster.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/cluster.js b/lib/cluster.js index 6e4dc4004e..1051291312 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -266,7 +266,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() { |