Skip to content

Commit abdbb29

Browse files
authored
Correctly rewrite socket timeouts on sending (#842)
1 parent 3873dfd commit abdbb29

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

neo4j/_async/io/_common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ async def flush(self):
139139
if data:
140140
try:
141141
await self.socket.sendall(data)
142-
except (OSError, asyncio.CancelledError) as error:
142+
except (
143+
OSError, SocketDeadlineExceeded, asyncio.CancelledError
144+
) as error:
143145
await AsyncUtil.callback(self.on_error, error)
144146
return False
145147
self._clear()

neo4j/_sync/io/_common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ def flush(self):
139139
if data:
140140
try:
141141
self.socket.sendall(data)
142-
except (OSError, asyncio.CancelledError) as error:
142+
except (
143+
OSError, SocketDeadlineExceeded, asyncio.CancelledError
144+
) as error:
143145
Util.callback(self.on_error, error)
144146
return False
145147
self._clear()

0 commit comments

Comments
 (0)