bpo-36801: Fix waiting in StreamWriter.drain for closing SSL transport#13098
bpo-36801: Fix waiting in StreamWriter.drain for closing SSL transport#13098miss-islington merged 2 commits intopython:masterfrom
Conversation
|
The backport to 3.7 is desired. |
| # ConnectionResetError otherwise | ||
| fut = self._protocol._get_close_waiter(self) | ||
| await fut | ||
| raise ConnectionResetError('Connection lost') |
There was a problem hiding this comment.
Do we want to raise an error from drain()? Maybe it should just return? What's the point of this error?
There was a problem hiding this comment.
That's how protocol._drain_helper() works now.
The future is set to exception only if the connection is closed with a failure.
But await writer.drain() raises ConnectionResetError.
I believe this is good: await writer.write(b'data') should fail loudly if the socket is closed.
There was a problem hiding this comment.
Maybe the code could be simplified by setting ConnectionResetError by connection_lost() callback handler but I'd like to keep the PR small.
Future improvement worth another pull request.
|
Thanks @asvetlov for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
pythonGH-13098) https://bugs.python.org/issue36801 (cherry picked from commit 1cc0ee7) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
|
GH-13176 is a backport of this pull request to the 3.7 branch. |
GH-13098) https://bugs.python.org/issue36801 (cherry picked from commit 1cc0ee7) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
|
Hi @asvetlov , I ran into a Note the subprocess ends very soon, and it seems |
|
BTW, here are some links I think might be helpful: |
|
cc @1st1 |
|
please do not post questions and cc people on long closed/merged PRs. Please use the discuss.python.org Help category - and only when it seems an actual CPython issue has been found, file a new issue in the issue tracker. |
https://bugs.python.org/issue36801