Fix: Check Attempts For Error even when Attempts is zero#131
Open
StounhandJ wants to merge 1 commit intoavast:mainfrom
Open
Fix: Check Attempts For Error even when Attempts is zero#131StounhandJ wants to merge 1 commit intoavast:mainfrom
StounhandJ wants to merge 1 commit intoavast:mainfrom
Conversation
tstromberg
added a commit
to codeGROOVE-dev/retry
that referenced
this pull request
Jul 28, 2025
This was referenced Jul 28, 2025
tstromberg
added a commit
to codeGROOVE-dev/retry
that referenced
this pull request
Jul 28, 2025
merge: Fix: Check Attempts For Error even when Attempts is zero avast#131
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.
This MR fixes a logic issue where AttemptsForError was ignored when the global Attempts value was set to 0. Since version 4.3.0, the retry library introduced AttemptsForError to allow fine-grained retry limits per error type. However, this mechanism was silently bypassed if retry.Attempts(0) was set, causing unexpected behavior and making debugging difficult.
Additionally, the logic for calling Is Recoverable was moved into the main retry loop to ensure it is properly respected for all configured attempts and error types.
Changes:
Apply AttemptsForError even if retry.Attempts(0) is used
Move IsRecoverable logic into the core retry loop to ensure it is evaluated consistently
Backward Compatibility:
This change makes retry behavior more consistent and does not break existing configurations unless users relied on the undocumented behavior of Attempts(0) disabling all retry logic.