Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSSLProtocol violates app Protocol state machine #246
Closed
Comments
|
@fantix any thoughts? |
|
Yes, it makes perfect sense to honor the |
kyuupichan
added a commit
to kyuupichan/aiorpcX
that referenced
this issue
Apr 19, 2019
* session closing is now robust; it is safe to await session.close() from anywhere
* API change: FinalRPCError removed; raise ReplyAndDisconnect instead. This responds with
a normal result, or an error, and then disconnects.
e.g. raise ReplyAndDisconnect(23)
raise ReplyAndDisconnect(RPCError(1, "message"))
* the session base class' private method _close() is removed. Use await close() instead.
* workaround uvloop bug `MagicStack/uvloop#246
|
@fantix Do you plan to implement this yourself? |
|
Yes! I'll create a PR for that. |
|
@fantix ping |
|
Ahhh that slipped through the cracks, let me make one PR now. |
fantix
added a commit
to fantix/uvloop
that referenced
this issue
Aug 14, 2019
* fixes MagicStack#246
Merged
fantix
added a commit
that referenced
this issue
Aug 24, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PYTHONASYNCIODEBUGin env?: YesSome instances of the
Protocolclass assumeconnection_lost()can only be called ifconnection_made()was called at some point. This does not appear to be explicitly guaranteed in the Python documentation, but the following comment strongly suggests that intent:https://github.com/python/cpython/blob/master/Lib/asyncio/protocols.py#L84
An error raised during the handshake phase triggers a transition back to
UNWRAPPED:https://github.com/MagicStack/uvloop/blob/master/uvloop/sslproto.pyx#L504
Following this code path further, we see that it will force close the transport, which triggers a call back to
SSLProtocol.connection_lost(). This is then forwarded onto the app'sProtocolinstance, even thoughconnection_made()was never called.Would it be appropriate to change the following guard to also exclude the
UNWRAPPEDstate?https://github.com/MagicStack/uvloop/blob/master/uvloop/sslproto.pyx#L337
Alternatively a boolean value could be used to track whether or not
connection_made()has ever been called.