Skip to content

feat(client): retry transient GET failures with backoff#37

Open
arseniy-pplx wants to merge 1 commit into
TangleML:masterfrom
arseniy-pplx:transfer/retry-transient-gets
Open

feat(client): retry transient GET failures with backoff#37
arseniy-pplx wants to merge 1 commit into
TangleML:masterfrom
arseniy-pplx:transfer/retry-transient-gets

Conversation

@arseniy-pplx

Copy link
Copy Markdown

Summary

  • retry idempotent GET requests on HTTP 500/502/503/504 and transient transport failures
  • use exponential backoff capped at 30 seconds, with at most seven attempts per logical request
  • raise requests.exceptions.SSLError on the first attempt: certificate failures are deterministic, so retrying only delays the report
  • leave mutating requests and streamed GETs single-attempt, and preserve the existing 429 Retry-After flow
  • route retry warnings through the configured client logger; pipeline-run, artifact, pipeline hydration, published-component, and secret commands pass their --log-type logger to the client, while logger-less programmatic clients remain silent

Context

Short backend restarts and connection resets currently fail read-only CLI operations immediately even though repeating the request is safe. This adds bounded recovery for GET requests without risking duplicate writes or changing rate-limit behavior, and keeps every retry visible through the logger each CLI command already configures.

Testing

  • uv run pytest tests/test_client.py tests/test_pipeline_runs_cli.py tests/test_artifacts_cli.py tests/test_components_cli.py tests/test_secrets_cli.py
  • uvx ruff check on the touched source files
  • uv lock --check
  • git diff --check

Idempotent GETs now retry on 500/502/503/504 and transient transport
errors (connection reset/refused, timeout, truncated body) with doubling
backoff capped at 30s, up to 7 attempts per logical request. Mutating
methods are never duplicated and streamed GETs are excluded so stream
consumers keep control of the open path. SSL certificate errors raise on
the first attempt because they are deterministic and retrying only
delays the report. The existing 429 Retry-After handling is unchanged
and composes with the new layer.

Retry warnings go through the client logger; pipeline-run, artifact,
pipeline hydration, published-component, and secret commands thread
their --log-type logger into the client so the warnings follow the
configured sink, and logger-less programmatic clients stay silent.
@arseniy-pplx
arseniy-pplx deleted the transfer/retry-transient-gets branch July 20, 2026 17:24
@arseniy-pplx
arseniy-pplx restored the transfer/retry-transient-gets branch July 20, 2026 17:26
@arseniy-pplx arseniy-pplx reopened this Jul 20, 2026
@arseniy-pplx
arseniy-pplx marked this pull request as ready for review July 20, 2026 18:11
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