-
-
Notifications
You must be signed in to change notification settings - Fork 34k
gh-94061: set a message to ConnectionResetError #94062
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
Conversation
|
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
The asyncio ssl error handling will now set a message for ConnectionResetError exception.
|
@vstinner can you take a look? |
| if self._state == SSLProtocolState.DO_HANDSHAKE: | ||
| self._on_handshake_complete(ConnectionResetError) | ||
| self._on_handshake_complete( | ||
| ConnectionResetError("SSL Connection reset by peer")) |
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.
I'm not convinced that it's always the case. SSLProtocol._do_shutdown() calls _call_eof_received().
If you want to pass a reason, I suggest adding a parameter to _call_eof_received(). And maybe add a private _eof_received() function which accepts a message. For example, eof_received() can simply call _eof_received() with a default message.
close() also starts a "shutdown" process which indirectly calls _call_eof_received().
So there are many ways to reach this line, and different reasons causing it.
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.
I don't think we have other reasons of why the connection is being reset here.
ConnectionResetError here is only raised if the state of the connection is SSLProtocolState.DO_HANDSHAKE.
The _call_eof_received() method can be called only by _do_shutdown() and _do_read()
_do_shutdown()is only called if the state isSSLProtocolState.SHUTDOWN._do_read()is only called if the state isSSLProtocolState.WRAPPED.
So this exception can only be raised at the early stage of the SSL connection establishment.
|
@vstinner thanks! |
|
Won't fix, see issue. |


The asyncio ssl error handling will now set a message for
ConnectionResetError exception.