GeezerVison is showing github.com — gh-160499: Pause asyncio TLS reads when SSL replies pile up by gpshead · Pull Request #160500 · python/cpython
Conversation
gpshead
commented
Oct 23, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
SSLProtocol read flow control only looked at the incoming BIO, so records OpenSSL writes on its own while processing a non-reading peer's input (TLS 1.2 renegotiation alerts, TLS 1.3 KeyUpdate replies) accumulated in the outgoing BIO without any bound. This counts that non-application output toward the read high-water mark and re-checks it from resume_writing(), so the transport stops reading from a peer that does not take the replies it solicits and resumes once it does. Application output is deliberately left out of the sum so that two peers which both write before they read cannot deadlock. The bound is coarse because the check runs after a whole transport read has been processed, so a single ~256 KiB read can still leave about 5.6 MB in the outgoing BIO before reads pause; resume_writing() now re-checks reading in every state rather than only from _do_read().
Fixes #160499
ANT-2026-RNWRQ22W
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
SSLProtocol read flow control only looked at the incoming BIO, so records
OpenSSL writes on its own while reading a non-reading peer (renegotiation
alerts, KeyUpdate replies) grew the outgoing BIO without bound. Count that
non-application output toward the read high-water mark and re-check it when
writing resumes.
ANT-2026-RNWRQ22W
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @gpshead for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12, 3.13, 3.14, 3.15.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
asvetlov
asvetlov approved these changes
picnixz
Awaiting requested review from picnixz
picnixz is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
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.
|