fix(client): avoid cross-loop eager body writers - #13359
Open
daleselaji-dev wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #13359 +/- ##
=======================================
Coverage 98.99% 98.99%
=======================================
Files 132 132
Lines 49156 49164 +8
Branches 2560 2560
=======================================
+ Hits 48661 48669 +8
Misses 371 371
Partials 124 124
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Merging this PR will not alter performance
Comparing Footnotes
|
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?
Guard aiohttp's Python 3.12+ eager request-body writer optimization so it is used only when the request is sent from the session's event loop. Cross-loop use now schedules the writer on the session loop instead of eagerly stepping a coroutine from the caller's thread.
Are there changes in behavior for the user?
Same-loop requests keep the existing eager-write optimization. Cross-loop misuse no longer lets a foreign thread execute a task against the session loop, avoiding the event-loop corruption described in #13346.
Related issue number
Fixes #13346
Testing