-
Notifications
You must be signed in to change notification settings - Fork 2.6k
pm2 with cron_restart restarts process while the process is still running #2395
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
Could you please double check that it does not enters in the SIGINT function. Something else, increase kill_timeout |
Hi,
And there weren't any log prints. |
we tried to listen to exit and that worked... |
+1 |
Cause the cron is running |
@vmarchaud it is looks like the cron is running process.exit with status code 0 not 1 ProcessContainerFork.js line 25 |
@Yontih Mybad i corrected my answer, but it doesnt change anything. |
Thanks for the PR @Yontih, just made some change to harden the cron workflow (restart instead of raw kill) + some tests You can try it: $ npm install Unitech/pm2#development -g
$ pm2 update |
@Unitech |
Landed in latest PM2 stable $ npm install pm2@latest -g |
@Yontih sounds interesting, PR welcome |
Also hitting this with using cron. All python processes spawned with ProcessPoolExecutor remain alive after job completion. |
If reporting a bug, please use the following template.
Expected behaviour
I need to prevent restarting script if the former didn't terminate
Actual behaviour
The script restarts
Steps to reproduce
...
Software versions used
PM2 Log output
Use the command:
tail --lines 50 ~/.pm2/pm2.log
PM2 App [temp] with id [1] and pid [43887], exited with code [0] via signal [SIGINT]
PM2 Starting execution sequence in -fork mode- for app name:temp id:1
PM2 App name:temp id:1 online
PM2 Starting execution sequence in -fork
I tried listening to process.on('SIGINT', function() {..}
to prevent exit if the script wan't done but it doesn't seem to enter the function.
Same for process.on('message', function(msg)
Thanks!
The text was updated successfully, but these errors were encountered: