Skip to content

fix: reap aiohttp sessions and auth locks belonging to closed event loops - #3009

Merged
copybara-service[bot] merged 1 commit into
mainfrom
copybara/988569879
Sep 26, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
copybara/988569879

Conversation

@copybara-service

Copy link
Copy Markdown

fix: reap aiohttp sessions and auth locks belonging to closed event loops

BaseApiClient caches its aiohttp session and asyncio auth lock per event loop
but never released an entry once that loop closed. Servers that run each
request on a fresh asyncio.run() loop therefore retained one session,
connector and socket set per request served. Entries whose loop is closed are
now dropped on the next access, bounding both caches by the number of live
loops.

@copybara-service
copybara-service Bot force-pushed the copybara/988569879 branch 2 times, most recently from 3fdf2b6 to 2c62b52 Compare September 26, 2026 03:19
…oops

`BaseApiClient` caches its aiohttp session and asyncio auth lock per event loop
but never released an entry once that loop closed. Servers that run each
request on a fresh `asyncio.run()` loop therefore retained one session,
connector and socket set per request served. Entries whose loop is closed are
now dropped on the next access, bounding both caches by the number of live
loops.

PiperOrigin-RevId: 988653992
@copybara-service
copybara-service Bot merged commit 6d01288 into main Sep 26, 2026
13 checks passed
@copybara-service
copybara-service Bot deleted the copybara/988569879 branch September 26, 2026 03:33

This branch was successfully deployed

1 active deployment
github-pages — 6d012889 Deployed Sep 26, 2026 by github-pages[bot] via deploy #1488
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant