Merge pull request #1734 from coreos-inc/fix-buildman

Make sure the etcd watch coroutines get called
This commit is contained in:
josephschorr 2016-08-16 14:31:20 -04:00 committed by GitHub
commit c01fc53cd1

View file

@ -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,