From 313d65a6a49c55b48516911cb47724c942efebae Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 16 Aug 2016 13:02:27 -0400 Subject: [PATCH] Make sure the etcd watch coroutines get called --- buildman/manager/ephemeral.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/buildman/manager/ephemeral.py b/buildman/manager/ephemeral.py index 4b097a990..b59838f3a 100644 --- a/buildman/manager/ephemeral.py +++ b/buildman/manager/ephemeral.py @@ -89,7 +89,7 @@ class EphemeralBuilderManager(BaseManager): # Map from build UUID to a BuildInfo tuple with information about the build. self._build_uuid_to_info = {} - def _watch_etcd(self, etcd_key, change_callback, start_index=None, recursive=True, + def _watch_etcd(self, etcd_key, change_coroutine_callback, start_index=None, recursive=True, restarter=None): watch_task_key = (etcd_key, recursive) def callback_wrapper(changed_key_future): @@ -134,10 +134,11 @@ class EphemeralBuilderManager(BaseManager): logger.exception('Exception on etcd watch: %s', etcd_key) if watch_task_key not in self._watch_tasks or self._watch_tasks[watch_task_key].done(): - self._watch_etcd(etcd_key, change_callback, start_index=new_index, restarter=restarter) + self._watch_etcd(etcd_key, change_coroutine_callback, start_index=new_index, + restarter=restarter) if etcd_result: - change_callback(etcd_result) + async(change_coroutine_callback(etcd_result)) if not self._shutting_down: logger.debug('Scheduling watch of key: %s%s at start index %s', etcd_key,