-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-127655: Ensure _SelectorSocketTransport.writelines pauses the protocol if needed
#127656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-127655: Ensure _SelectorSocketTransport.writelines pauses the protocol if needed
#127656
Conversation
_SelectorSocketTransport.writelines pauses the protocol if needed
Misc/NEWS.d/next/Security/2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst
Outdated
Show resolved
Hide resolved
|
Looks like the CI failure was GitHub being flakey and not an actual problem AFAICT |
|
I will review later today.
…--Guido (mobile)
On Thu, Dec 5, 2024 at 14:25 Seth Michael Larson ***@***.***> wrote:
@sethmlarson <https://github.com/sethmlarson> requested your review on:
#127656 <#127656> gh-127655
<#127655>: Ensure
_SelectorSocketTransport.writelines pauses the protocol if needed.
—
Reply to this email directly, view it on GitHub
<#127656 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWCWMR5R5HAQRB5UCXG5A32EDHGDAVCNFSM6AAAAABTDMMDRGVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJVGU2TCMZUGQ3DIMI>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
gvanrossum
left a comment
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.
The one-line fix looks good.
The test doesn't really test anything except that the new logic is in place -- it doesn't prove at all that it does what it claims to do (prevent memory filling up if the other end never reads). But that's hard to test without bringing the test machine to its knees, so as long as you have tested this on one of your actual reproducing scenarios, I'm okay with this.
I suppose some people will be surprised that they are now paused by voluminous writelines() calls where previously they weren't. (What happens if you are paused but you keep calling writelines() anyway?) But consistency with write() is more important, and that may already pause. So I'm okay with this, since writelines() is supposed to be equivalent to multiple write() calls.
Misc/NEWS.d/next/Security/2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst
Outdated
Show resolved
Hide resolved
Misc/NEWS.d/next/Security/2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst
Outdated
Show resolved
Hide resolved
Yeah but if you still continue to call writelines then I guess the memory will go unbounded right? |
|
@python/organization-owners please add me so I can view the advisory |
Yes if the implementation doesn't |
|
Thanks @bdraco for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
gh-127655: Ensure writelines pauses the protocol if needed
Note for reviewers: 3.12+ only since writelines only exists since 3.12.