From f5cff2ced591904bc0ea7fc6028c10308ca8ffb0 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Sun, 11 Sep 2016 14:28:49 -0500 Subject: [PATCH] Revert "Flush the queued items in linear periodically" This reverts commit d3418fd6580bfadc14f418b371d9dfe88c947921. --- lib/ansible/plugins/strategy/__init__.py | 2 +- lib/ansible/plugins/strategy/linear.py | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/ansible/plugins/strategy/__init__.py b/lib/ansible/plugins/strategy/__init__.py index 65b645a3d0c..d1036d4a662 100644 --- a/lib/ansible/plugins/strategy/__init__.py +++ b/lib/ansible/plugins/strategy/__init__.py @@ -181,7 +181,7 @@ class StrategyBase: return False passes = 1 - while not self._tqm._terminated and passes < 3 and self._pending_results > 0: + while not self._tqm._terminated and passes < 3: try: task_result = self._final_q.get(timeout=timeout) original_host = get_original_host(task_result._host) diff --git a/lib/ansible/plugins/strategy/linear.py b/lib/ansible/plugins/strategy/linear.py index a843ae57e6a..08b7a52c565 100644 --- a/lib/ansible/plugins/strategy/linear.py +++ b/lib/ansible/plugins/strategy/linear.py @@ -266,14 +266,10 @@ class StrategyModule(StrategyBase): if run_once: break - # flush the queue if we've got more items than we have workers, - # and read back any results which may have arrived already - if len(items_to_queue) > len(self._tqm._workers): - self._tqm.queue_multiple_tasks(items_to_queue, play_context) - items_to_queue = [] - - if self._pending_results > 0: - results += self._process_pending_results(iterator, one_pass=True) + # FIXME: probably not required here any more with the result proc + # having been removed, so there's no only a single result + # queue for the main thread + results += self._process_pending_results(iterator, one_pass=True) self._tqm.queue_multiple_tasks(items_to_queue, play_context)