diff options
author | Ben Bangert <ben@groovie.org> | 2017-05-31 14:56:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-31 14:56:26 -0700 |
commit | c82a98b8066b128caaa07cd7814be8c54e61adb2 (patch) | |
tree | ed888f2c21785567315976063829f2f47c84327f | |
parent | c85969a4809b0d6be270ae6791b31ee4676c2c62 (diff) | |
parent | fa47be45c1f8787ce48fea135563f2579e92ce4e (diff) | |
download | kazoo-c82a98b8066b128caaa07cd7814be8c54e61adb2.tar.gz |
Merge pull request #418 from josephaltmaier/master
Always call _safe_close() on KazooClient.stop() so we don't leak work…
-rw-r--r-- | kazoo/client.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kazoo/client.py b/kazoo/client.py index f6e985d..46aaae6 100644 --- a/kazoo/client.py +++ b/kazoo/client.py @@ -615,8 +615,10 @@ class KazooClient(object): 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.""" |