From a34f9487910efe2b35ee7cc8b479da03bcc0be2a Mon Sep 17 00:00:00 2001 From: Vishal Gowda Date: Thu, 15 Jun 2017 15:30:30 +0530 Subject: [PATCH] Shutdown worker droid when zk conn is lost --- hedroid/worker/zk_droid.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hedroid/worker/zk_droid.py b/hedroid/worker/zk_droid.py index 9eb5a65..aaaff6f 100644 --- a/hedroid/worker/zk_droid.py +++ b/hedroid/worker/zk_droid.py @@ -1,4 +1,5 @@ import json +import sys from kazoo.client import KazooClient, KazooState from kazoo.recipe.watchers import DataWatch @@ -26,6 +27,7 @@ def conn_listener(state): logger.debug('connected...') elif state == KazooState.LOST: logger.debug('connection lost...') + sys.exit() elif state == KazooState.SUSPENDED: logger.debug('connection suspended...')