Fix no-pooling session isolation#118
Merged
hownowstephen merged 2 commits intomainfrom May 6, 2026
Merged
Conversation
|
@cusror review |
joeybaer
approved these changes
May 6, 2026
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.
Summary
Context
Applies the concept from #94 to current main. #109 avoided a None.close() traceback, but disabled pooling could still share self._current_session across concurrent requests.
Tests
Note
Medium Risk
Changes HTTP session lifecycle and request dispatching, which can affect performance and retry/connection behavior under load. Adds coverage for concurrent no-pooling requests to reduce regression risk.
Overview
Fixes
ClientBasesouse_connection_pooling=Falsecreates and closes a freshrequests.Sessionper request (via a context manager) instead of sharingself._current_sessionacross calls.Simplifies session management by removing
_get_session/_closeand related logging, and adds regression tests verifying pooled session reuse and isolation/cleanup for overlapping no-pooling requests.Reviewed by Cursor Bugbot for commit d5edf59. Bugbot is set up for automated code reviews on this repo. Configure here.