Skip to content

Commit

Permalink
Correctly rewrite socket timeouts on sending (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
robsdedude authored Oct 28, 2022
1 parent 3873dfd commit abdbb29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion neo4j/_async/io/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ async def flush(self):
if data:
try:
await self.socket.sendall(data)
except (OSError, asyncio.CancelledError) as error:
except (
OSError, SocketDeadlineExceeded, asyncio.CancelledError
) as error:
await AsyncUtil.callback(self.on_error, error)
return False
self._clear()
Expand Down
4 changes: 3 additions & 1 deletion neo4j/_sync/io/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def flush(self):
if data:
try:
self.socket.sendall(data)
except (OSError, asyncio.CancelledError) as error:
except (
OSError, SocketDeadlineExceeded, asyncio.CancelledError
) as error:
Util.callback(self.on_error, error)
return False
self._clear()
Expand Down

0 comments on commit abdbb29

Please sign in to comment.