It looks like my worker receives two TERM signals when the Heroku dyno is restarted. Heroku docs says that:
When the dyno manager restarts a dyno, the dyno manager will request that your processes shut down gracefully by sending them a SIGTERM signal. This signal is sent to all processes in the dyno, not just the process type.
So that's the first signal. I guess the second signal is sent by the master process to the worker.
I am doing Delayed::Worker.raise_signal_exceptions = :term and rescue from SignalException to do some cleanup before exiting. In the case of two signals, the first is handled but the second is gets left unhandled. Any ideas on how to handle this two signals situation?
It looks like my worker receives two TERM signals when the Heroku dyno is restarted. Heroku docs says that:
So that's the first signal. I guess the second signal is sent by the master process to the worker.
I am doing
Delayed::Worker.raise_signal_exceptions = :termand rescue fromSignalExceptionto do some cleanup before exiting. In the case of two signals, the first is handled but the second is gets left unhandled. Any ideas on how to handle this two signals situation?