-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
gh-109051: asyncio: remove outgoing buffer from sslproto #109571
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
base: main
Are you sure you want to change the base?
Conversation
This breaks so many tests that I didn't see locally. Feel free to downgrade to draft or close. |
Possibly fixed what was breaking. But I'm less confident of the validity of the change because I had to touch sendfile stuff. My stubborn idea was that The alternative fix is much easier (but feels dirtier to me). Something like: in start_tls, report an error if the transport is not a _FlowControlMixin, and then pass down the value of Even in this case, the redundant "outgoing" buffer in the wrapper could be removed (again, unless I'm missing something important), but it's an orthogonal issue. |
You can make it draft yourself. Maybe @vstinner can help? |
cc @1st1 |
asyncio/sslproto.py TLS wrapper has a redundant outgoing buffer (the MemoryBIO object already serves as a buffer), and a flow control layer for outgoing data which serves an unclear purpose
If this extra logic can be removed, it would solve the AssertionError issue described in the issue as a secondary effect, because the asserted condition cannot be guaranteed in general (details in issue comments).
For reference, the current sslproto.py code was ported from uvloop, which manifests the same issue. The uvloop implementation uses the MemoryBIO directly as a write buffer, but still has the extra flow control logic which causes the mismatch.