fix: reap aiohttp sessions and auth locks belonging to closed event loops - #3009
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
copybara/988569879
branch
2 times, most recently
from
September 26, 2026 03:19
3fdf2b6 to
2c62b52
Compare
…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
Bot
force-pushed
the
copybara/988569879
branch
from
September 26, 2026 03:33
2c62b52 to
6d01288
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: reap aiohttp sessions and auth locks belonging to closed event loops
BaseApiClientcaches its aiohttp session and asyncio auth lock per event loopbut 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.