summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Saffroy <saffroy@users.noreply.github.com>2019-11-10 11:41:39 +0100
committerStephen SORRIAUX <stephen.sorriaux@gmail.com>2019-11-10 11:41:39 +0100
commitc7e80503f3be97d26ff2de27f9e424070c8181bb (patch)
tree69676adbbedeefe497d6838f8710af5a1d5584ef
parentc293aabf39676b94006cf736f9f75392637b8292 (diff)
downloadkazoo-c7e80503f3be97d26ff2de27f9e424070c8181bb.tar.gz
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.
-rw-r--r--kazoo/client.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/kazoo/client.py b/kazoo/client.py
index f4c21fa..6c066a0 100644
--- a/kazoo/client.py
+++ b/kazoo/client.py
@@ -628,6 +628,7 @@ class KazooClient(object):
if not self.connected:
# We time-out, ensure we are disconnected
self.stop()
+ self.close()
raise self.handler.timeout_exception("Connection time-out")
if self.chroot and not self.exists("/"):