Closed michaelBenin closed 8 years ago
After doing a bit more research using reload and adding the process.on('message').
Solution here: http://pm2.keymetrics.io/docs/usage/cluster-mode/#graceful-reload
With the 1.0 you will be also able to do this in any kind of process: http://pm2.keymetrics.io/docs/usage/signals-clean-restart/
I've found that even with graceful reload pm2 still load balances work to workers that are shutting down.
Ah ok, I am using the latest of what's published on NPM. Any timeframe when 1.0 will be available on npm? Is it stable to use installing from github? I see 1.0 has been cut for a couple days.
I will publish it today :)
Testing this later today to see if PM2 still sends incoming traffic to a shutting down process.
Related: https://github.com/Unitech/pm2/issues/1303#issuecomment-164960671
Use case:
During a graceful shutdown call process.send('offline'); to let pm2 that the current process should be treated as a non running process. Similarly how the api exists for process.send('online');