Skip to content

Reset backoff state after non-retryable API errors - #1596

Merged
antoineeripret merged 2 commits into
burnash:masterfrom
lovewave02:fix/backoff-counter-after-terminal-error
Jul 16, 2026
Merged

Reset backoff state after non-retryable API errors#1596
antoineeripret merged 2 commits into
burnash:masterfrom
lovewave02:fix/backoff-counter-after-terminal-error

Conversation

@lovewave02

Copy link
Copy Markdown
Contributor

What changed

A non-retryable API error currently increments BackOffHTTPClient's retry
counter before the error is returned. If the same client later hits a retryable
error, its first delay starts at 4 seconds instead of 2 seconds.

This resets the counter before propagating a terminal API error. The regression
test exercises a 403 -> 500 -> success sequence and verifies that the 500 starts
with the normal 2-second delay.

Verification

  • tox -e lint,py,build,doc
  • 161 tests passed
  • package and Sphinx warning-as-error builds passed

@lovewave02 lovewave02 mentioned this pull request Jul 15, 2026
@antoineeripret

Copy link
Copy Markdown
Collaborator

Hey @lovewave02,

Thank you for the PR, love it :)

Can you apply the same change to RefreshError that suffers from the same issue though?

Thank you !

@antoineeripret
antoineeripret merged commit a2b595b into burnash:master Jul 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants