From 0498a48e8fe913b58f4ca276eb238d5eaec96f76 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sat, 29 Mar 2014 17:14:25 -0700 Subject: [PATCH] Worker executor adjustments - Reset the notify_timeout on start (to ensure that the notification thread will continue working on repeated stops/starts) - Adjust comment of stop/start method to reflect that more than just the proxy thread is started and stopped. Fixes bug 1300373 Change-Id: I534fa87d9f3b9cfd7aa553f157cb7e776a08f54f --- taskflow/engines/worker_based/executor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/taskflow/engines/worker_based/executor.py b/taskflow/engines/worker_based/executor.py index 4c4fc060..77c54737 100644 --- a/taskflow/engines/worker_based/executor.py +++ b/taskflow/engines/worker_based/executor.py @@ -190,16 +190,19 @@ class WorkerTaskExecutor(executor.TaskExecutorBase): return async_utils.wait_for_any(fs, timeout) def start(self): - """Start proxy thread.""" + """Start proxy thread (and associated topic notification thread).""" if self._proxy_thread is None: self._proxy_thread = self._make_thread(self._proxy.start) self._proxy_thread.start() self._proxy.wait() + self._notify_timeout.reset() self._notify_thread = self._make_thread(self._notify_topics) self._notify_thread.start() def stop(self): - """Stop proxy, so its thread would be gracefully terminated.""" + """Stop proxy thread (and associated topic notification thread), so + those threads will be gracefully terminated. + """ if self._proxy_thread is not None: if self._proxy_thread.is_alive(): self._notify_timeout.interrupt()