I think it’s better to add description to this sidekiq page about how to deploy safely with long running jobs, because default behavior just kill running jobs when deployement and killed jobs will not run again.
This is not kind behavior because we could not notice if there were running jobs and killed jobs after deployment.
I think simple solution is using timeout option when running sidekiq like following.
From the sidekiq documentation the recommendation seems to be to send a TSTP signal, and then the SIGTERM.
Any more info on this? (I found a couple of other posts on the topic, like Shutdown timetous for Sidekiq worker ) If I was running on a virtual server, I’d be able to login and send the signal to the running process. The only other idea I had was to to have an in-app signalling mechanism for the sidekiq worker to shut itself down. That could be triggered by the deploy process, currently triggered a Github Action in my case.
While I don’t have a critical need for it yet (hopefully soon), I’m wondering how other production workloads are handling frequent deploys that might kill running jobs.