Skip to content

Fix aiohttp buffered response body error handling 🪿✨ - #2000

Draft
jar-stripe wants to merge 2 commits into
masterfrom
fix-aiohttp-body-read-errors
Draft

jar-stripe wants to merge 2 commits into
masterfrom
fix-aiohttp-body-read-errors

Conversation

@jar-stripe

@jar-stripe jar-stripe commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Why?

Buffered aiohttp response-body failures escape as raw exceptions and bypass max_network_retries.

What?

Route buffered body-read failures through the existing error handler to raise retryable APIConnectionErrors with preserved causes. Add regression coverage for payload errors, timeouts, exact retry budgets, recovery, and cancellation, plus a patch changefile. Explicit streaming behavior remains unchanged.

See Also

Fixes #1993

Configuration

  • skip-changefile: This PR is not a user-facing change, so there's no changefile.

Committed-By-Agent: goose
Orbit-Session-Id: 5fb90387-7427-4606-8a20-d00aea91367b
Simplify regression-test setup by replacing the async error helper with distinct exception instances, removing an unused partial-body value, and wrapping the existing successful reader rather than duplicating its return value. These changes remove redundant setup without altering production behavior or assertions for retry counts, exception causes, recovery, and cancellation.

All 31 aiohttp tests passed. Targeted formatting and git diff --check also passed.

Committed-By-Agent: goose
Orbit-Session-Id: 5fb90387-7427-4606-8a20-d00aea91367b

This branch has not been deployed

No deployments
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.

AIOHTTPClient: errors while reading the response body escape as raw aiohttp/asyncio exceptions and are never retried

1 participant