You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IMPORTANT NOTE: If you set up a repeated job, you must ensure that you either do not set a result_ttl value or set one that is larger than the job interval. Otherwise, the job's details will expire, and the job will not be rescheduled.
However, I’m encountering a slightly different issue.
I have set my result_ttl as int(1.5 * interval)
Here is my setup (a semplified one):
1 worker
1 scheduled job (SJ_2m) with an interval of 2 minutes (the job takes 1 minute to complete)
1 scheduled job (SJ_60m) with an interval of 60 minutes (the job takes 10 minutes to complete)
Initially, I created SJ_2m, and it get scheduled and ran smoothly. Then, I added SJ_60m.
Since SJ_2m was created earlier and has already completed successfully, it is now in a SUCCESS state with a TTL of 2 minutes * 1.5 = 3 minutes (180 seconds).
When the next run time for SJ_2m arrives, it is added to the queue, but since the only worker is still busy (e.g., for 6 minutes), SJ_2m must wait. However, because the result_ttl is less than the time the worker becomes available (i.e., less than 6 minutes), the job details expire, and the job disappears, preventing it from being rescheduled.
I’m currently facing this issue in my project, and I believe the note should emphasize that even if you set a result_ttl value larger than the job interval, there is still no guarantee that the job details won’t expire. As a result, the job may not be rescheduled as expected if the worker is unavailable for longer than the result_ttl value.
The text was updated successfully, but these errors were encountered:
I would also suggest that the IMPORTANT NOTE warning be implemented as a check in the code, and potentially throw an exception if result_ttl is set and not larger than the interval.
I was about to offer a PR for this, but seeing 77 open PRs pending, I'm not sure if this project is actively maintained. I would appreciate any input on this!
As stated in the README:
However, I’m encountering a slightly different issue.
I have set my result_ttl as
int(1.5 * interval)
Here is my setup (a semplified one):
Initially, I created SJ_2m, and it get scheduled and ran smoothly. Then, I added SJ_60m.
Since SJ_2m was created earlier and has already completed successfully, it is now in a SUCCESS state with a TTL of 2 minutes * 1.5 = 3 minutes (180 seconds).
When the next run time for SJ_2m arrives, it is added to the queue, but since the only worker is still busy (e.g., for 6 minutes), SJ_2m must wait. However, because the result_ttl is less than the time the worker becomes available (i.e., less than 6 minutes), the job details expire, and the job disappears, preventing it from being rescheduled.
I’m currently facing this issue in my project, and I believe the note should emphasize that even if you set a result_ttl value larger than the job interval, there is still no guarantee that the job details won’t expire. As a result, the job may not be rescheduled as expected if the worker is unavailable for longer than the result_ttl value.
The text was updated successfully, but these errors were encountered: