Skip to content

Commit

Permalink
fix(core): when connection fails, close the ConnectionHandler (#577) (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
saffroy authored and StephenSorriaux committed Nov 10, 2019
1 parent c293aab commit c7e8050
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kazoo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ def start(self, timeout=15):
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("/"):
Expand Down

0 comments on commit c7e8050

Please sign in to comment.