LearnBoost / cluster

Node.JS multi-core server manager with plugins support.
http://learnboost.github.com/cluster
MIT License
2.29k stars 159 forks source link

Delay workers from closing (Closes #167) #170

Open smtlaissezfaire opened 12 years ago

smtlaissezfaire commented 12 years ago

We need to do some db cleanup before exiting workers (same issues seen #167).

The old implementation calls process.nextTick(process.exit()) - which prevents any new code on the event queue from running after the event is emitted, but before process.exit() is called.

Also, it appears as though the 'close' event was never propagated up to the master. I decided to propagate 'worker closed' instead.

Commit Message:

This closes #167