summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSam Roberts <sam@strongloop.com>2013-12-17 16:04:20 -0800
committerTimothy J Fontaine <tjfontaine@gmail.com>2013-12-31 11:43:44 -0800
commit876d3bd85aabe7fce71a025a89c6b3f6ddbf2053 (patch)
treeaae8017194a544ee0c2d7583ad71c4bd18a8395c /lib
parentdce35146e0e52de32c3836d01ada10f3ebbe8792 (diff)
downloadnodejs-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.js4
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;