Skip to content

Commit 9352e7e

Browse files
committed
Fix stuck autoreconnect case
When we call ping() at a not connected socket the following call trace is proceeded: ping() -> _send_request() -> _opt_reconnect() -> {here self.socket is None} -> connect() -> {inconnect is set to True} -> connect_basic() -> connect_tcp() -> raise NetworkError -> fall though try-except in connect() -> use null self._socket when try to send a packet. A test case ('test_01_simple') will be added within the following commit.
1 parent e80ba14 commit 9352e7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tarantool/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def connect(self):
210210
self._socket.settimeout(self.socket_timeout)
211211
self.load_schema()
212212
self.inconnect = False
213-
except socket.error as e:
213+
except Exception as e:
214214
self.connected = False
215215
self.inconnect = False
216216
raise NetworkError(e)

0 commit comments

Comments
 (0)