diff options
author | James Cammarata <jimi@sngx.net> | 2016-08-26 14:55:56 -0500 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2016-08-31 13:33:01 -0500 |
commit | b71957d6e6d666dc9594e798e4230e908c19b299 (patch) | |
tree | 712996a0883fbf7e73b330af8403d4534e287796 /lib/ansible/plugins/strategy/linear.py | |
parent | 9ecec6c28ed048dcceacdfd3d98dcee7c05f3d23 (diff) | |
download | ansible-b71957d6e6d666dc9594e798e4230e908c19b299.tar.gz |
Move queuing tasks to a background thread
Diffstat (limited to 'lib/ansible/plugins/strategy/linear.py')
-rw-r--r-- | lib/ansible/plugins/strategy/linear.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/ansible/plugins/strategy/linear.py b/lib/ansible/plugins/strategy/linear.py index 3f273606e2..4bedad5ea5 100644 --- a/lib/ansible/plugins/strategy/linear.py +++ b/lib/ansible/plugins/strategy/linear.py @@ -181,7 +181,9 @@ class StrategyModule(StrategyBase): any_errors_fatal = False results = [] + items_to_queue = [] for (host, task) in host_tasks: + if not task: continue @@ -252,14 +254,20 @@ class StrategyModule(StrategyBase): display.debug("sending task start callback") self._blocked_hosts[host.get_name()] = True - self._queue_task(host, task, task_vars, play_context) + items_to_queue.append((host, task, task_vars)) + self._pending_results += 1 del task_vars # if we're bypassing the host loop, break out now if run_once: break - 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) # go to next host/task group if skip_rest: |