Skip to content

Merge stable into develop - #1333

Merged
infrahub-github-bot-app[bot] merged 1 commit into
developfrom
stable
Sep 8, 2026
Merged

Merge stable into develop#1333
infrahub-github-bot-app[bot] merged 1 commit into
developfrom
stable

Conversation

@infrahub-github-bot-app

@infrahub-github-bot-app infrahub-github-bot-app Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Merging stable into develop after merging pull request #1323.


Summary by cubic

Retries transient failures on every SDK request path when retry_on_failure is enabled, so long-running scripts and generators no longer abort on temporary Infrahub outages. Previously only connection errors in execute_graphql were retried; now dropped connections, timeouts, HTTP 500/502/503/504 responses, and transient GraphQL errors are retried with exponential backoff and jitter.

  • Adds retry_max_delay and retry_status_codes; max_retry_duration=0 retries indefinitely.
  • Uploads from non-rewindable streams are buffered to a temp file; interrupted downloads restart without leaving partial files behind.

Migration

  • retry_delay must now be greater than 0; configuring 0 is rejected.

Written for commit ff7a597. Summary will update on new commits.

Review in cubic

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>
@infrahub-github-bot-app
infrahub-github-bot-app Bot requested a review from a team as a code owner September 8, 2026 15:02
@github-actions github-actions Bot added the type/documentation Improvements or additions to documentation label Sep 8, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 8, 2026

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: d3ad29e
Status: ✅  Deploy successful!
Preview URL: https://140aa951.infrahub-sdk-python.pages.dev
Branch Preview URL: https://fac-prep-1-23-2-hecha.infrahub-sdk-python.pages.dev

View logs

@infrahub-github-bot-app
infrahub-github-bot-app Bot merged commit ac8a841 into develop Sep 8, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant