Skip to content

Commit cc11d7c

Browse files
committed
Fix hang when connection is lost during response receive
1 parent 9160c58 commit cc11d7c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tarantool/connection.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ def _recv(self, to_read):
168168
raise NetworkError(socket.error(errno.ECONNRESET,
169169
"Lost connection to server during query"))
170170
else:
171+
if len(tmp) == 0:
172+
raise NetworkError(socket.error(errno.ECONNRESET,
173+
"Lost connection to server during query"))
171174
to_read -= len(tmp)
172175
buf += tmp
173176
return buf

0 commit comments

Comments
 (0)