Skip to content

Commit

Permalink
Merge pull request #418 from josephaltmaier/master
Browse files Browse the repository at this point in the history
Always call _safe_close() on KazooClient.stop() so we don't leak work…
  • Loading branch information
bbangert authored May 31, 2017
2 parents c85969a + fa47be4 commit c82a98b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kazoo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,10 @@ def stop(self):

self._stopped.set()
self._queue.append((CloseInstance, None))
self._connection._write_sock.send(b'\0')
self._safe_close()
try:
self._connection._write_sock.send(b'\0')
finally:
self._safe_close()

def restart(self):
"""Stop and restart the Zookeeper session."""
Expand Down

0 comments on commit c82a98b

Please sign in to comment.