-
Notifications
You must be signed in to change notification settings - Fork 53
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
Set job to failed when task raises and job is aborting (regardless retry) #1133
Set job to failed when task raises and job is aborting (regardless retry) #1133
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great! I believe there may be a bit of conflict when we merge the worker refactor, though.
Thank you so much for the time you spent and doing it all over again after my comment!
@@ -385,6 +385,7 @@ def job_func(a, b): # pylint: disable=unused-argument | |||
task_name="job", | |||
queue="yay", | |||
) | |||
app.job_manager.get_job_status_async = mocker.AsyncMock(return_value="doing") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious: what happens if we don't mock? The InMemory implementation doesn't answer correctly ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll throw. The job is not put into the worker queue. The run_job
method is tested in isolation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, makes sense!
@onlyann When I commit this (later today), can you include it in the worker refactoring?
No prob, the comment was very relevant. And I am happy that we don't need a migration 🙂. |
That's not a problem, I will resolve the conflict. I think it's fine to merge this fix but wanted to highlight that there can still be a race condition where the job is changed to "aborting" between the check and the moment the job is set to retry. Something we can look at improving if we end up removing that extra status in v3 |
Alright, I will write a note in the documentation, merge it, and make a patch release. |
👍 |
Closes #1131
Successful PR Checklist:
PR label(s):
This time, a job with the status
aborting
of a task that raises is set tofailed
(regardless of whether it should be retried or not). It feels a bit more consistent to me, but somehow, there is no optimal way. If we set a to-be-retried job in statusaborting
toaborted
when the task raises, but one tofailed
that should not be retried, it seems somehow inconsistent to me.@ewjoachim A note in the documentation is still missing. Just want to hear what you think.