This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author giampaolo.rodola
Recipients Arfrever, flox, giampaolo.rodola, janssen, jcea, pitrou, vstinner
Date 2010-04-06.11:05:34
SpamBayes Score 8.655692e-08
Marked as misclassified No
Message-id <1270551936.79.0.470749857386.issue8108@psf.upfronthosting.co.za>
In-reply-to
Content
def handle_error(self):
-            raise
+            # Ignore errors while closing, because the remote end could have
+            # abruptly shut down the TCP connection while we are still
+            # waiting for SSL shutdown to finish.
+            if not self._ssl_closing:
+                raise


I don't like this.
I should have said that I think my original patch is wrong as it attempts to shutdown() the SSL layer in asyncore's close() method.
I think that I should have done that in handle_close() instead of close() because the two methods are called in different circumstances and have different meanings:

- handle_close() is supposed to be called when the connection is a about to be closed "in a clean way" (for example: the other end properly finished to transmit all the data).

- close() may be called in different situations, also when the connection gets closed abruptly. In this case we should avoid to shutdown() the SSL layer as we might be dealing with a "dead" connection. The right thing to do in this case is just close() the socket without doing anything else.

IMHO, what we should try to avoid to do here is silently ignoring any error condition as you did in handle_error() method.
What happens if you move the SSL shutdown() call in handle_close() method and leave handle_error() unchanged?
History
Date User Action Args
2010-04-06 11:05:37giampaolo.rodolasetrecipients: + giampaolo.rodola, jcea, janssen, pitrou, vstinner, Arfrever, flox
2010-04-06 11:05:36giampaolo.rodolasetmessageid: <1270551936.79.0.470749857386.issue8108@psf.upfronthosting.co.za>
2010-04-06 11:05:35giampaolo.rodolalinkissue8108 messages
2010-04-06 11:05:35giampaolo.rodolacreate