cluster: fix premature 'disconnect' event
authorBen Noordhuis <info@bnoordhuis.nl>
Mon, 14 Oct 2013 09:38:53 +0000 (11:38 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Mon, 14 Oct 2013 09:46:09 +0000 (11:46 +0200)
commit45885a1e8c3177acea04b61fffc7acd799a646ad
tree72d5f151300c97ace76644d104c308ee0b25a17e
parent527cae22ff8ab193bf17e5dff7420dd50480e407
cluster: fix premature 'disconnect' event

Don't emit the 'disconnect' event until all workers have gone away.
Before this commit, the event was emitted when all open handles were
closed, which usually - but not always - amounts to the same thing.

Fixes #6346.
lib/cluster.js
test/simple/test-cluster-disconnect-idle-worker.js [new file with mode: 0644]