Skip to content

Commit c7e8050

Browse files
saffroyStephenSorriaux
authored andcommitted
fix(core): when connection fails, close the ConnectionHandler (#577) (#579)
When connection attempts fail repeatedly (e.g. all ZK servers are unavailable), eventually the socketpair in the ConnectionHandler fills up, and the Client gets stuck trying to write a single byte to the socketpair. Avoid this by ensuring we close the socketpair on a failed connection attempt.
1 parent c293aab commit c7e8050

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kazoo/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ def start(self, timeout=15):
628628
if not self.connected:
629629
# We time-out, ensure we are disconnected
630630
self.stop()
631+
self.close()
631632
raise self.handler.timeout_exception("Connection time-out")
632633

633634
if self.chroot and not self.exists("/"):

0 commit comments

Comments
 (0)