diff options
author | Sam Roberts <sam@strongloop.com> | 2013-12-17 16:04:20 -0800 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2013-12-31 11:43:44 -0800 |
commit | 876d3bd85aabe7fce71a025a89c6b3f6ddbf2053 (patch) | |
tree | aae8017194a544ee0c2d7583ad71c4bd18a8395c /lib | |
parent | dce35146e0e52de32c3836d01ada10f3ebbe8792 (diff) | |
download | nodejs-876d3bd85aabe7fce71a025a89c6b3f6ddbf2053.tar.gz nodejs-876d3bd85aabe7fce71a025a89c6b3f6ddbf2053.tar.bz2 nodejs-876d3bd85aabe7fce71a025a89c6b3f6ddbf2053.zip |
cluster: do not synchronously emit 'setup' event
This is a problem present in both v0.10, and v0.11, where the 'setup'
event is synchronously emitted by `cluster.setupMaster()`, a mostly
harmless anti-pattern.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cluster.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/cluster.js b/lib/cluster.js index f75fda521..4f8fb8c45 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -269,7 +269,9 @@ function masterInit() { process._debugProcess(cluster.workers[key].process.pid); }); - cluster.emit('setup'); + process.nextTick(function() { + cluster.emit('setup'); + }); }; var ids = 0; |