Skip to content

Commit c82a98b

Browse files
authored
Merge pull request #418 from josephaltmaier/master
Always call _safe_close() on KazooClient.stop() so we don't leak work…
2 parents c85969a + fa47be4 commit c82a98b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kazoo/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,10 @@ def stop(self):
615615

616616
self._stopped.set()
617617
self._queue.append((CloseInstance, None))
618-
self._connection._write_sock.send(b'\0')
619-
self._safe_close()
618+
try:
619+
self._connection._write_sock.send(b'\0')
620+
finally:
621+
self._safe_close()
620622

621623
def restart(self):
622624
"""Stop and restart the Zookeeper session."""

0 commit comments

Comments
 (0)