Repository navigation
feat(worker): add task_retry_on_worker_lost to limit requeues after worker loss - #10843
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10843 +/- ##
==========================================
+ Coverage 90.46% 90.47% +0.01%
==========================================
Files 153 153
Lines 21216 21244 +28
Branches 2580 2583 +3
==========================================
+ Hits 19192 19221 +29
Misses 1710 1710
+ Partials 314 313 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
previous partial fix #9720 |
auvipy
left a comment
There was a problem hiding this comment.
should we also consider smoke or integration tests for this new config settings based feature?
|
Added a smoke test that kills the worker on every run with Passes locally with both Redis and RabbitMQ. |
|
@MehrazRumman @GangEunzzang please review |
|
@abdullahmujahidali did you checked this comment? #8969 (reply in thread) whats your view on that? |
|
@caspervdw would you mind checking and reviewing this PR? |
DLX approach works but only on RabbitMQ PR uses Celery's own retries count so it works the same on Redis and SQS too (the smoke test runs on both Redis and RabbitMQ) They don't really combine though retries strip the |
|
Looks good overall. I ran it against
A few things I noticed, none blocking:
The five new tests fail on |
|
@abdullahmujahidali we need to address 1-4 from the last review |
|
Thanks @GangEunzzang @auvipy for the ping Pushed changes for all four:
updated the unit tests to cover these. |
@abdullahmujahidali couldnt see the pushed commit yet. did you forget to push? |
Sorry I forgot just pushed |
|
I still cant see the changes in latest commit |
Description
Fixes #9082 (see also discussion #8969)
With
task_reject_on_worker_lost, a task whose worker dies is requeued with no limit, since the broker doesn't count requeues.This adds an opt-in
task_retry_on_worker_lostsetting. When it's on, a lost worker retries the task likeTask.retry()does, somax_retriesanddefault_retry_delayapply. When retries run out, the task is marked as failed. Default is off, so existing behaviour doesn't change.One open question: if sending the retry fails, the task is currently marked as failed. Would falling back to requeue be better?