Merge "Don't wait for forever to join streamer" into feature/zuulv3
diff --git a/zuul/ansible/callback/zuul_stream.py b/zuul/ansible/callback/zuul_stream.py
index 2068925..4424bb9 100644
--- a/zuul/ansible/callback/zuul_stream.py
+++ b/zuul/ansible/callback/zuul_stream.py
@@ -166,9 +166,16 @@
self._streamer.daemon = True
self._streamer.start()
- def v2_runner_on_failed(self, result, ignore_errors=False):
+ def _stop_streamer(self):
if self._streamer:
- self._streamer.join()
+ self._streamer.join(30)
+ if self._streamer.is_alive():
+ msg = "{now} | [Zuul] Log Stream did not terminate".format(
+ now=datetime.datetime.now())
+ self._log.info(msg)
+
+ def v2_runner_on_failed(self, result, ignore_errors=False):
+ self._stop_streamer()
if result._task.action in ('command', 'shell'):
zuul_filter_result(result._result)
self._handle_exception(result._result)
@@ -194,8 +201,7 @@
if result._task.action in ('include', 'include_role'):
return
- if self._streamer:
- self._streamer.join()
+ self._stop_streamer()
if result._result.get('changed', False):
status = 'changed'