joyent/node — pull request #6346 by fiws (2013-10-13 20:14:46+00:00)
Title: cluster.disconnect callback getting called too early in 0.11

``` JavaScript
var cluster = require('cluster');

if (cluster.isMaster) {
// Fork workers.
cluster.fork();
cluster.fork();

// "called when all workers are disconnected [...]"
cluster.disconnect(function(){
for(var prop in cluster.workers){
var worker = cluster.workers[prop];
console.log(worker.state);
}
});

} else {
require('net').createServer().listen(8000);
}
```
It seems like the disconnect callback is getting called to early. If I loop through the workers I still get one with the 'online' state. This does not happen on 0.10

Expected output: nothing or disconnect/exit
got: online

node version: v0.11.7
OS: Ubuntu Linux 64bit