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.
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.
@asvetlov Hi Andrew! I revisited this one today and tried to write a test - looks like in
_fatal_error
:https://github.com/python/cpython/blob/7b3ab5921fa25ed8b97b6296f97c5c78aacf5447/Lib/asyncio/selector_events.py#L711-L721
It will call
connection_lost()
, which will eventually call_wakeup_waiter()
:https://github.com/asvetlov/uvloop/blob/133ce7c81882958056da4a4b908e4704f8f0e31b/uvloop/sslproto.pyx#L324-L349
I tried to send EOF during handshake and couldn't reproduce the hanging situation - I've also tried to remove this
_wakeup_waiter()
call here in python/cpython#17975 and all asyncio-related tests passed. I'm worried that I might have missed something here, could you please shed some light?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.
@fantix I think we can pick up this PR and finish it, if @asvetlov isn't available. Or merge it as is if it's correct and add small touchups/tests in a follow up PR.
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.
@1st1 I think we can merge this PR without further tests, because:
SSLProtocol.connection_lost
and wakeup the waiter.connection_lost()
call on close. But in uvloop we hard-coded the transport to be one ofTCPTransport
,UnixTransport
orSSLTransport
, and the user would have to use Cython to create a buggy transport subclass to reproduce this issue. (I tried in CPython as a unit test but it seemed not quite possible)