fix(sidekiq): Report error when retry limit is below attempt_threshold#2940
Merged
Merged
Conversation
|
This PR has been automatically closed. The referenced issue does not show a discussion between you and a maintainer. To avoid wasted effort on both sides, please discuss your proposed approach in the issue first and wait for a maintainer to respond before opening a PR. Please review our contributing guidelines for more details. |
This was referenced Apr 27, 2026
When a job's `retry` option is lower than its `attempt_threshold` (e.g. `retry: 1` with `attempt_threshold: 3`), the error handler skipped every attempt and the job was silently dropped — it died before ever reaching the threshold. Cap the threshold at the job's final attempt so these jobs still report before entering the dead set. Jobs whose retry count meets or exceeds the threshold behave exactly as before.
e36501f to
180fe75
Compare
sl0thentr0py
approved these changes
May 4, 2026
Member
sl0thentr0py
left a comment
There was a problem hiding this comment.
thx @marcboquet and apologies for the bot auto-close!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2940 +/- ##
==========================================
+ Coverage 90.13% 90.55% +0.41%
==========================================
Files 132 142 +10
Lines 5301 5630 +329
==========================================
+ Hits 4778 5098 +320
- Misses 523 532 +9
🚀 New features to boost your workflow:
|
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.
Description
Fix #2939
The
attempt_threshold(added in #2503) has a bug when a job'sretryoption is lower than itsattempt_threshold(e.g.retry: 1withattempt_threshold: 3).In those cases the error handler skipped every attempt and the job was silently dropped.
This PR caps the threshold at the job's final attempt so these jobs still report before entering the dead set. Jobs whose retry count meets or exceeds the threshold behave exactly as before.