feat: retry 502/503/504 with jittered backoff (SHA-1994)#1
Merged
Conversation
Sync + async HTTP clients now retry up to 3 times on transient upstream failures (502/503/504 or connect/read errors) with full-jitter exponential backoff (500ms base → 4s cap). Shields SDK users from the ~3s cold-start gap when sharp-api-go restarts during deploys. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Python 3.9 reached EOL 2025-10. The package declared 3.9 support but has never actually worked on 3.9 — models.py uses `int | float` union syntax which Pydantic evaluates at runtime and which fails on 3.9. Main-branch CI has been red on 3.9 since the initial release. Rather than adding a runtime dependency (eval_type_backport) or rewriting all PEP 604 unions, drop 3.9 from the test matrix and bump floors in pyproject.toml (requires-python, classifiers, ruff target-version, pyright pythonVersion). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mlaz-code
added a commit
that referenced
this pull request
May 7, 2026
* feat: retry 502/503/504 with jittered backoff Sync + async HTTP clients now retry up to 3 times on transient upstream failures (502/503/504 or connect/read errors) with full-jitter exponential backoff (500ms base → 4s cap). Shields SDK users from the ~3s cold-start gap when the SharpAPI server restarts during deploys. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: drop Python 3.9 support Python 3.9 reached EOL 2025-10. The package declared 3.9 support but has never actually worked on 3.9 — models.py uses `int | float` union syntax which Pydantic evaluates at runtime and which fails on 3.9. Main-branch CI has been red on 3.9 since the initial release. Rather than adding a runtime dependency (eval_type_backport) or rewriting all PEP 604 unions, drop 3.9 from the test matrix and bump floors in pyproject.toml (requires-python, classifiers, ruff target-version, pyright pythonVersion). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Context
Filed against SHA-1994. During the SHA-1929 deploy on 2026-04-19 15:53 UTC, sharp-api-go was restarted via systemctl to pick up new ClickHouse env vars — this caused 74 × 5xx over ~3s for live customer requests. The server side is being fixed with a dedicated config-reload helper (sharp-api-go repo), and the SDKs add defense-in-depth retry so SDK users don't see the gap at all.
Test plan
🤖 Generated with Claude Code