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
Repeat Jobs not Rescheduling #1345
Comments
Resolved, we had duplicate I lied, ran into the issue again . |
well apparently something when it gets marked as completed , and I must be shutting down the queues, so it stops doing whatever its suppose todo. Im unable to find the job via Way to reproduce:
|
just added a check to see if we add a job, and its already completed, just re add it
|
If you delete the delayed job then you are effectively breaking the iterations, since it is when the delayed job gets promoted when the next iteration is scheduled. What I find strange is that you do not find the job when calling "getRepeatableJobs". Why are you deleting the delayed job in the first place? |
For the cron jobs we call delete repeatable jobs on boot (because they may have changed schedules) and re add them . We actually don’t call delete job it was a way to reproduce the issue (we’re not sure how it gets in the situation where it gets completed and the delayed job disappears) |
it may be related to #1344 , they were failing as well (we only keep 500 failed jobs) notice same issue with failed jobs / completed |
Ok so dug way deeper on this, its all because of how we are trying to make sure we have updated cron schedules. We currently are remove all repeatable jobs, then re-adding them. This allows us to make sure we have all updated cron schedules (we could check 1 by 1). The problem is when we do this , if the old cron had completed / failed , it would reuse the same repeat key, 1 ,2 3, 4,5. So the problem is that we need to remove all jobs related to that cron rather than just the repeatable job. Although im not sure this is adventurous since we may remove failed jobs that need to be looked at. So , our current plan is to look at the repeatable jobs one by one, and dont remove them they exist in the schedule. if they don't exist in the schedule any longer, we will remove the cron and all of its failed / completed as well. |
Hey Luke, do you mind sharing a code snippet of what this looks like? I think I am facing the same issue right now. |
Im grabbing these from multiple classes so it may not make 100% sense but ill post what i can. We first get the list of cron jobs that we are going to schedule . Then remove them.
Then we re-add them but we also add a timestamp to combat some of the issues above
|
We've seen this in production, sometimes our repeat jobs never get rescheduled, even though they are completed.
This happens randomly , but happens pretty often after restarts / deployments.
We do gracefully shutdown our queues as well.
The text was updated successfully, but these errors were encountered: