Skip to content

python: retry connection resets on idempotent GET requests - #6814

Merged
gz merged 1 commit into
mainfrom
retry-more-api-requests
Aug 6, 2026
Merged

python: retry connection resets on idempotent GET requests#6814
gz merged 1 commit into
mainfrom
retry-more-api-requests

Conversation

@blp

@blp blp commented Aug 5, 2026

Copy link
Copy Markdown
Member

A connection reset mid-poll (e.g. status polling during compilation) was raised immediately as FelderaCommunicationError with no retry, turning a transient network blip into a hard client failure. GET is idempotent, so retry ConnectionError there; leave POST/PUT/PATCH/DELETE unretried since a lost response may hide an already-applied write.

Describe Manual Test Plan

Ran unit tests.

A connection reset mid-poll (e.g. status polling during compilation)
was raised immediately as FelderaCommunicationError with no retry,
turning a transient network blip into a hard client failure. GET is
idempotent, so retry ConnectionError there; leave POST/PUT/PATCH/DELETE
unretried since a lost response may hide an already-applied write.

Signed-off-by: Ben Pfaff <blp@feldera.com>
@blp
blp requested a review from gz August 5, 2026 21:23
@blp blp self-assigned this Aug 5, 2026
@blp blp added bug Something isn't working QA Testing and quality assurance python Pull requests that update python code labels Aug 5, 2026
@blp
blp enabled auto-merge August 5, 2026 21:27
@blp
blp added this pull request to the merge queue Aug 5, 2026

@mythical-fred mythical-fred left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retry ConnectionError only for GET (idempotent) via a new is_idempotent = http_method is requests.get gate threaded into _is_retryable. POST/PUT/PATCH/DELETE keep the old behaviour — a lost response there may hide an already-applied write, so resubmitting is unsafe. Correct call: mid-poll connection resets during compilation status polls should not turn into hard FelderaCommunicationErrors. Tests cover all three paths (GET-retry-then-success, GET-retry-exhaust-then-wrapped, POST-no-retry). No new deps, tight diff (+42/-7).

The identity check http_method is requests.get is deliberate and fine given the SDK only exposes get/post/put/patch/delete helpers, but if HEAD/OPTIONS ever get plumbed through, extend the set (or key off http_method.__name__ against {"get","head","options"}).

@gz
gz removed this pull request from the merge queue due to a manual request Aug 5, 2026
@gz
gz added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit d109e13 Aug 6, 2026
1 check passed
@gz
gz deleted the retry-more-api-requests branch August 6, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python Pull requests that update python code QA Testing and quality assurance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants