Skip to content

Close temporary async sessions when requests fail - #966

Open
Shubham-Padkonde wants to merge 1 commit into
twilio:mainfrom
Shubham-Padkonde:fix/async-temporary-session-cleanup
Open

Shubham-Padkonde wants to merge 1 commit into
twilio:mainfrom
Shubham-Padkonde:fix/async-temporary-session-cleanup

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

When pool_connections=False, request failures, body-decoding errors and cancellation can leave the per-request aiohttp session open. Close temporary sessions in a finally block while preserving pooled-session ownership.

Adds five regression tests. The three failure-path tests fail before this fix and pass afterward.

Validation: async HTTP tests 12 passed; flake8 and formatting checks passed. Full make test: 644 passed, 2 existing proxy-test failures caused by this environment's REQUESTS_CA_BUNDLE value. Both failures were reproduced with unchanged upstream implementation.

Prepared with Codex assistance.

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.

1 participant