-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Graceful Exit #1732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Cluster or fork? |
Cluster. |
Ok, the graceful exit handler on our SIGINT and SIGTERM had to be synchronous functions. We used node fibers in order to execute all our cleanup functions before PM2 kills the process. |
Can you provide a code sample? |
I think this is now handled by the kill_timeout option. |
The issue was that we called disconnect() on processes in cluster, throwing all the exit logic. Now it has been fixed:
|
Patch available on [email protected] (main): $ npm install pm2 -g
$ pm2 update |
Might be related to #729 and fe92e71
We are a pm2 and keymetrics user.
We handle graceful exit of child processes on SIGINT. However, the process is killed even before the graceful exit function is called. This is because after you issue a process.kill(pid, 'SIGINT') call, you immediately kill the process tree.
The text was updated successfully, but these errors were encountered: