From 2ed9b3d2437e19c7369dfd83c4eeed71d89dcf14 Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Tue, 23 Dec 2014 14:54:34 -0500 Subject: [PATCH] Disable the etcd timeout on watch calls to prevent them from disconnecting the client. --- buildman/manager/ephemeral.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildman/manager/ephemeral.py b/buildman/manager/ephemeral.py index 3b467bb23..ac603b9ce 100644 --- a/buildman/manager/ephemeral.py +++ b/buildman/manager/ephemeral.py @@ -21,6 +21,7 @@ logger = logging.getLogger(__name__) ETCD_BUILDER_PREFIX = 'building/' ETCD_EXPIRE_RESULT = 'expire' +ETCD_DISABLE_TIMEOUT = 0 class EphemeralBuilderManager(BaseManager): @@ -52,7 +53,8 @@ class EphemeralBuilderManager(BaseManager): """ Watch the builders key for expirations. """ if not self._shutting_down: - workers_future = self._etcd_client.watch(ETCD_BUILDER_PREFIX, recursive=True) + workers_future = self._etcd_client.watch(ETCD_BUILDER_PREFIX, recursive=True, + timeout=ETCD_DISABLE_TIMEOUT) workers_future.add_done_callback(self._handle_key_expiration) logger.debug('Scheduling watch task.') self._worker_watch_task = async(workers_future)