Unitech/pm2 — pull request #68 by truongsinh (2013-08-06 12:01:39+00:00)
Title: gracefully reload process

# What is the problem
My processes are online and listening. I am going to deploy new code. I have to suffer 1-10 seconds server downtime during the restart (even with dump-kill-resurrect). I want to have zero downtime deployment.

# How is the problem solved
When `reload` signal receive, newWorkers `fork()` ed and made `listening()`. When a newWorker is `listening`, corresponding oldWorker current process `disconnect()`s http://nodejs.org/api/cluster.html#cluster_worker_disconnect , i.e. the oldWorker will no longer accept new connections, but they (new connections) will be handled by newWorker(s). Existing connection will be allowed to exit as usual.

# What is still wrong
Only 'reload all' at this moment, please give feedback and discuss.