-
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
Multiple issues with graceful reload #2874
Comments
Looking around the source code, this seems to be reason for the incorrect behavior. The commit which introduced the change is a53fd17a70 and its commit message seems to suggest it's actually intended to behave this way. If so, is it correct to say that gracefulReload is not supported when the wait-ready functionality is used? |
@jiripospisil Indeed thats not normal, we will issue a fix for it. |
gracefulReload is a deprecated command use reload instead |
Okay, after playing with it for a while it seems to do the right thing, I will use it instead. One other thing I noticed is that PM2 allows to set the number of concurrent actions (I would like to set it to 1 to go really easy on the machine) but the way it's coded makes it impossible to actually set the user defined value because it will always be overwritten by the Node.js version check (at least in my case). I noticed there's #2690 so maybe you want to tackle that in one go. |
@jiripospisil Yeah its planned to fix it, but feel free to make a PR for it :) |
Does this also apply to startOrGracefulReload? So that using startOrReload is the correct way? |
@Unitech Can you please be so kind to provide us feedback on that topic? TIA! |
You should always use |
Thanks @vmarchaud, very appreciated. |
@vmarchaud we are unsure by the used wording what you exactly suggest. |
@vmarchaud please :) |
What's going wrong?
It seems the graceful reload command doesn't work properly anymore. Based on the logs, it seems to be confused about the state of the individual processes. It also doesn't seem to be "graceful", as in it doesn't seem to wait until the new process is ready to replace the old one.
How could we reproduce this issue?
The script is supposed to log "Started" at the very beginning and then send "ready" (and print it) to the master process after 5 seconds. It then logs "Working" every 1s. When the process is being gracefulReloaded, it's supposed to log the message and exit in 5 seconds.
My understanding of gracefulReload is that for each existing process A (in sequence, not in parallel, basically a sequential reload) it should start a new process A1, wait for it to be "ready", then send SIGINT to A and wait for it to exit.
This is what I'm seeing instead:
The log mentions that the processes were in "stopped" state but obviously that was not the case because they were logging at the time. It also sent the SIGINT signal to them immediately instead of waiting for the new ones to be ready and replacing them. I'm also a bit confused about the number of "msg=failed to kill" messages but that might a side effect of the above. Any ideas what's wrong? Thanks!
Supporting information
The text was updated successfully, but these errors were encountered: