From 49736b3ae835c3bf6d44f005d29447b714da2dca Mon Sep 17 00:00:00 2001 From: David Wilson Date: Mon, 10 Sep 2018 00:31:16 +0100 Subject: [PATCH] ansible: fix FileService call, and remove another roundtrip. --- ansible_mitogen/connection.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ansible_mitogen/connection.py b/ansible_mitogen/connection.py index 6c2ef4b0..4ec00308 100644 --- a/ansible_mitogen/connection.py +++ b/ansible_mitogen/connection.py @@ -879,7 +879,14 @@ class Connection(ansible.plugins.connection.ConnectionBase): method_name='register', path=mitogen.utils.cast(in_path) ) - self.call( + + # A roundtrip is always necessary for the target to request the file + # from FileService, however, by pipelining the transfer function, the + # subsequent step (probably a module invocation) can get its + # dependencies and function call in-flight before the transfer is + # complete. This saves at least 1 RTT between the transfer completing + # and the start of the follow-up task. + self.get_chain().call_no_reply( ansible_mitogen.target.transfer_file, context=self.parent, in_path=in_path,