Skip to content

Retry API calls on transient connection errors - #215

Merged
johndgiese merged 1 commit into
mainfrom
retry-connection-errors
Jul 28, 2026
Merged

Retry API calls on transient connection errors#215
johndgiese merged 1 commit into
mainfrom
retry-connection-errors

Conversation

@johndgiese

Copy link
Copy Markdown
Contributor

Two consecutive full article re-pulls of innolitics.github.io died mid-run with ConnectionError('Connection reset by peer') during S3 file downloads (Client.download_file_get_url). Those methods are decorated with @retry_api_call, but the wrapper only retries Notion rate-limit / retryable API-response errors — a transient transport-level failure kills the whole export.

Now requests.exceptions.ConnectionError is retried with linear backoff (2s, 4s, 6s, 8s) up to the same max_api_retries. Two unit tests added (retry-then-succeed, and exhaustion re-raises).

🤖 Generated with Claude Code

https://claude.ai/code/session_01EwuTg4uAA3UCEeiNLqtpdC

Long pulls with many file downloads intermittently die with
"Connection reset by peer" (requests.exceptions.ConnectionError), which
retry_api_call did not catch - it only retried Notion rate-limit and
retryable API-response errors. Retry connection errors with linear
backoff, up to the same max attempt count.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EwuTg4uAA3UCEeiNLqtpdC
@johndgiese
johndgiese merged commit 9c0dec4 into main Jul 28, 2026
4 checks passed
@johndgiese
johndgiese deleted the retry-connection-errors branch July 28, 2026 06:58
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.

1 participant