-
Notifications
You must be signed in to change notification settings - Fork 57
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
Incorrect count for attempts upon ultimate failure? #113
Comments
Thinking about this further it seems like
|
Happy to consider a PR. |
I'm a bit usure what would be the "correct" behaviour and even a solution that could be accepted. The way I see this issue it is hard to solve it witout introducing breaking changes in some way. The simplest solution that I can think of would be to let Another solution would be to make a distinction between "the number of attempts each job is configured with" and "the number of remaining attempts". This can be achieved by adding a new property of the job that hold the number of attempts that was initially configured for the job, which would not change during job execution / retries. Naming is hard but names such as Do you have any thoughts or preferences here? |
Steps to reproduce the behavior
attempts
has reached0
The following code demonstrates the issue:
Expected behavior
I would expect
attempts
on the job to be set to0
when all retries has been exhaused, andretries
be set to<attempts> - 1
as that would be the actual number of retries. In other words: total number of attempts = the initial attempt + nine retries.Expected output from the above script:
Actual behavior
The task is marked with the correct number of performed
retries
, but remainingattempts
stops at1
instead of0
.Actual output from the script:
Given that
attempts
steadily decrease as the job is retried I would assume thatattempts
hit zero when no remaining attempts were left.To me it seems like the meaning of
attempts
kind of changes during the task lifecycle. By that I mean thatattempts
starts out as "how many times the jobs is to be attempted before transitioning to a failed state" but after the task has transitioned tofailed
the meaning is suddenly "indication that the task had one initial attempt" so that if you summarizeattempts
andretries
you get the same number as initially passed in theattempts
-attribute to->enqueue()
.The text was updated successfully, but these errors were encountered: