Skip to content

Commit 5831934

Browse files
authored
PYTHON-3691 [Build Failure] test_client.TestClient.test_exhaust_network_error (#1216)
1 parent 2fe0192 commit 5831934

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pymongo/pyopenssl_context.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ def _call(self, call, *args, **kwargs):
107107
try:
108108
return call(*args, **kwargs)
109109
except BLOCKING_IO_ERRORS as exc:
110+
# Check for closed socket.
111+
if self.fileno() == -1:
112+
if timeout and _time.monotonic() - start > timeout:
113+
raise _socket.timeout("timed out")
114+
raise SSLError("Underlying socket has been closed")
110115
if isinstance(exc, _SSL.WantReadError):
111116
want_read = True
112117
want_write = False

0 commit comments

Comments
 (0)