-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[FEATURE] wait-ready
for shutdown
#2979
Comments
would you be courageous enough for a PR? ;) |
Sure, what do you think about the idea? I know it's common place to exit, but the thought of lingering in flight requests without at least a header thrown back out with 503 or similar makes me uncomfortable. |
After thinking a bit about this, disabling new incoming queries to a specific worker is not possible right now as we are using the cluster module to handle lb. Maybe it's possible to interface with the cluster module to do that but it requires some deeper inspection. |
Sounds good 👍 - is there a branch or discussion? Maybe I can contribute towards that instead. |
Mainly in reference to #2995 - but any update or timeline for pm2 v3? |
The
wait-ready
property is extremely useful. It would be great to have a similar option for a worker to send a message to pm2 telling it to explicitly kill itself. The benefit here is pm2 knows not to send connections/requests and to give the worker some time to gracefully shutdown. This is best used foruncaughtException
,unhandledRejection
use cases.Example:
What I really want to eliminate here is the node/worker process closing server, cleaning up and gracefully shutting down while pm2 doesn't yet know that worker is attempting to shutdown because of some uncaught exception unknown to parent process (pm2).
The text was updated successfully, but these errors were encountered: