def _stop_client(self):
"""Best effort to stop the client."""
try:
# Make sure not to mistake this scenario with failing to stop
# client.
if self._client is None:
log.info("Kazoo client is None.")
return
_retry((Exception,), tries=3, delay=1, backoff=2,
sleep_func=gevent.sleep)(self._client.stop)()
log.info("Successfully stopped kazoo client.")
except (Exception, gevent.Timeout):
self._sc.increment("errors.zk.client.stop.failure",
tags={'host': hostname},
sample_rate=1)
log.exception("Failed to stop kazoo client.")
评论列表
文章目录