Avoid redundant _release_connection calls#12221
Open
rodrigobnogueira wants to merge 1 commit intoaio-libs:masterfrom
Open
Avoid redundant _release_connection calls#12221rodrigobnogueira wants to merge 1 commit intoaio-libs:masterfrom
rodrigobnogueira wants to merge 1 commit intoaio-libs:masterfrom
Conversation
2be3b22 to
a68aac5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #12221 +/- ##
=======================================
Coverage 99.11% 99.11%
=======================================
Files 130 130
Lines 45324 45361 +37
Branches 2392 2396 +4
=======================================
+ Hits 44921 44958 +37
Misses 271 271
Partials 132 132
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
819d985 to
a09c0e2
Compare
a09c0e2 to
0a29170
Compare
|
|
||
| self._cleanup_writer() | ||
| self._release_connection() | ||
| if self._connection is not None: |
Member
There was a problem hiding this comment.
This check already happens inside _release_connection(). Is it the function call itself that's adding too much overhead? I'll leave @bdraco to review this one.
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.
What do these changes do?
This change removes redundant ClientResponse._release_connection() invocations on successful request paths.
Are there changes in behavior for the user?
Yes, internal behavior changed: a successful request now executes one release-path call per response instead of repeated no-op release calls. Connection reuse/cleanup semantics are preserved.
Is it a substantial burden for the maintainers to support this?
No. The change is small, localized, and covered by regression + existing suite coverage.
Related issue number
Fixes #10089
Checklist