Resuming long running tasks from where they left off in sidekiq after SIGTERM/SIGKILL #6018
Closed
blaizmannen
started this conversation in
General
Replies: 1 comment
-
I will go ahead and answer my own question that indeed yes, Sidekiq by nature cannot possibly know how to resume the job from where it left off without actually changing the Job itself |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So on kubernetes, I have a sidekiq deployment. Whenever there is a scale-down operation/deployment update on the sidekiq deployment, the pods will receive a TERM, wait N seconds(25) and then eventually be killed. This causes long running jobs to be interrupted, and will have to be restarted from the start.
In hopes of fixing this, we came up with creating a preStop hook, that:
However, when the job gets re-queued, it resumes from the very beginning.
I am unsure if I am missing something fundamental here. Is there something I can fix so that sidekiq will resume long running jobs from where they left off, or do I have to configure the job in such a way that supports this?
Here is the Worker job that I run to test this:
Beta Was this translation helpful? Give feedback.
All reactions