feat: auto-disable recurring task after 4 consecutive failures#221
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #221 +/- ##
==========================================
+ Coverage 97.32% 97.38% +0.05%
==========================================
Files 104 105 +1
Lines 4525 4586 +61
==========================================
+ Hits 4404 4466 +62
+ Misses 121 120 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add is_disabled and num_consecutive_failures to RecurringTask. mark_failure increments the counter and flips is_disabled when it reaches the threshold; mark_success resets it. Pickup SQL is updated to skip disabled rows so dead tasks stop wasting worker cycles. Surfaced in the Django admin with a "Re-enable selected tasks" action.
for more information, see https://pre-commit.ci
fbc56bd to
f358de0
Compare
gagantrivedi
commented
Apr 30, 2026
khvn26
requested changes
Apr 30, 2026
khvn26
left a comment
Member
There was a problem hiding this comment.
The approach seems sound to me — I've only called out lack of logging.
khvn26
reviewed
Apr 30, 2026
- Emit an error log when the consecutive-failure threshold flips a recurring task to disabled, so ops can see flapping tasks getting quarantined. - Use a one-line `...` stub for the never-executed dummy task in the disabled-task test so coverage doesn't flag the unreachable body.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
is_disabledandnum_consecutive_failurestoRecurringTask.mark_failureincrements the counter and flipsis_disabledonce it hits 4;mark_successresets it.Test plan