Skip to content

fix(client): reset aiohttp session before mTLS retry#2306

Open
MukundaKatta wants to merge 2 commits intogoogleapis:mainfrom
MukundaKatta:codex/python-genai-reset-mtls-session
Open

fix(client): reset aiohttp session before mTLS retry#2306
MukundaKatta wants to merge 2 commits intogoogleapis:mainfrom
MukundaKatta:codex/python-genai-reset-mtls-session

Conversation

@MukundaKatta
Copy link
Copy Markdown

Summary

  • close and clear the existing aiohttp session before retrying connector failures in the async mTLS path
  • ensure the retry path creates a fresh AsyncAuthorizedSession instead of reusing the broken one
  • add a regression test that verifies the first mTLS session is closed and replaced on retry

Testing

  • python3 -m py_compile google/genai/_api_client.py google/genai/tests/client/test_retries.py
  • python3 -m pytest google/genai/tests/client/test_retries.py -k "mtls_session or connector_error_recreates_mtls_session" (the targeted test was skipped in this environment because aiohttp-specific test prerequisites are unavailable)

@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this Apr 20, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:XL Code changes > 100 lines label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL Code changes > 100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants