Repository navigation
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 |
|
This PR is stale because it has been open for 30 days with no activity. |
eeb5a21 to
08eb83c
Compare
- Remove unused imports flagged by ruff (asyncio.base_events, asyncio.sslproto). - Add Misc/NEWS.d entry for pythongh-109051 (bedevere/news). - test_ssl: rewrite test_remote_shutdown_receives_trailing_data_on_slow_socket to fill the transport buffer instead of the removed _test__append_write_backlog helper, mirroring the sibling test rewrite already in this PR. - test_sslproto: stop mocking sslobj.write() failures; without an outgoing write buffer those errors propagate instead of being buffered and retried. Co-authored-by: Muse Code (Meta Muse Spark)
de32f84 to
8b26ebc
Compare
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.