Merge develop into infrahub-develop - #1335
Merged
Merged
Conversation
retry_on_failure only covered connection errors inside execute_graphql, gave up after max_retry_duration, spun without delay on HTTP 5xx, and never looked at REST calls or at GraphQL error envelopes, so a generator running for hours aborted on the first transient infrastructure error. A TransientRetryHandler now drives every request path of both clients: GraphQL queries and mutations, REST endpoints such as query_gql_query and schema loading, multipart uploads and streamed downloads. It retries connection errors, connections dropped before a response arrives (the shape a load balancer failover takes on an in-flight request), every httpx timeout, HTTP 500/502/503/504 responses and GraphQL envelopes whose errors all carry one of those statuses, sharing one time budget and attempt counter across the transport and envelope layers. Anything else still fails fast. Retries use exponential backoff with jitter from retry_delay up to the new retry_max_delay; a zero for either is rejected since it would turn every retry into a tight loop. retry_status_codes tunes which statuses count as transient, and max_retry_duration=0 retries indefinitely. Each retry is logged with its attempt number and elapsed time, escalating from WARNING to ERROR after five minutes, and once the budget is spent the original error is raised. retry_on_failure and retry_delay are properties so they can be toggled at runtime. Uploads from a stream that cannot be rewound are copied once to a temporary file, off the event loop in the async client, so a retried send carries the full body. A streamed download whose connection drops mid-body raises ServerNotResponsiveError, is restarted on the shared budget by the file handler, and never leaves a partial file behind. Opt-in integration tests (INFRAHUB_TESTING_FAILOVER=1) restart HAProxy and the API servers mid-mutation against a real deployment. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Merge stable into develop
Deploying infrahub-sdk-python with
|
| Latest commit: |
ac8a841
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bade05b9.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://develop.infrahub-sdk-python.pages.dev |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## infrahub-develop #1335 +/- ##
====================================================
+ Coverage 85.54% 86.15% +0.61%
====================================================
Files 148 149 +1
Lines 14271 14542 +271
Branches 1953 1998 +45
====================================================
+ Hits 12208 12529 +321
+ Misses 1496 1446 -50
Partials 567 567
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
infrahub-github-bot-app
Bot
merged commit Sep 8, 2026
61197aa
into
infrahub-develop
43 checks passed
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.
Merging develop into infrahub-develop after merging pull request #1333.
Summary by cubic
Expands opt-in
retry_on_failurefrom handling only GraphQL connection errors to covering transient failures across every SDK request path. The client now retries dropped or timed-out connections, transient HTTP responses, and flagged GraphQL errors, while non-transient errors still fail immediately.Retry behavior
retry_delayand the newretry_max_delay.retry_status_codescontrols transient HTTP statuses, andmax_retry_duration=0enables unlimited retries.Validation
INFRAHUB_TESTING_FAILOVER=1for load balancer and API restarts.Written for commit ac8a841. Summary will update on new commits.