File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 2020import logging
2121import os
2222import socket
23+ import ssl
2324import sys
2425import time
2526import weakref
@@ -1033,7 +1034,10 @@ def _handle_connection_error(self, error: BaseException) -> None:
10331034 assert isinstance (error , AutoReconnect ) # Appease type checker.
10341035 # If the original error was a DNS, certificate, or SSL error, ignore it.
10351036 if isinstance (error .__cause__ , (_CertificateError , SSLErrors , socket .gaierror )):
1036- return
1037+ # End of file errors are excluded, because the server may have disconnected
1038+ # during the handshake.
1039+ if not isinstance (error .__cause__ , ssl .SSLEOFError ):
1040+ return
10371041 error ._add_error_label ("SystemOverloadedError" )
10381042 error ._add_error_label ("RetryableError" )
10391043
Original file line number Diff line number Diff line change 2020import logging
2121import os
2222import socket
23+ import ssl
2324import sys
2425import time
2526import weakref
@@ -1029,7 +1030,10 @@ def _handle_connection_error(self, error: BaseException) -> None:
10291030 assert isinstance (error , AutoReconnect ) # Appease type checker.
10301031 # If the original error was a DNS, certificate, or SSL error, ignore it.
10311032 if isinstance (error .__cause__ , (_CertificateError , SSLErrors , socket .gaierror )):
1032- return
1033+ # End of file errors are excluded, because the server may have disconnected
1034+ # during the handshake.
1035+ if not isinstance (error .__cause__ , ssl .SSLEOFError ):
1036+ return
10331037 error ._add_error_label ("SystemOverloadedError" )
10341038 error ._add_error_label ("RetryableError" )
10351039
You can’t perform that action at this time.
0 commit comments