From d6c4a983e13879cd75229a7eba795a7e93520ead Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 31 Jan 2019 22:09:23 +0000 Subject: [PATCH] service: PushFileService never recorded a file as sent. Ansible modules were being resent continuously - but only the main script module, and any custom modutils if any were present. Wire footprint drops by ~1/3rd for a 500 task run of 'shell: hostname': -rw-r--r-- 1 root root 584K Jan 31 22:06 500mito-before2 -rw-r--r-- 1 root root 434K Jan 31 22:04 500mito-filesbugonly --- mitogen/service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mitogen/service.py b/mitogen/service.py index 93b46a69..9d9cf2da 100644 --- a/mitogen/service.py +++ b/mitogen/service.py @@ -634,7 +634,7 @@ class PushFileService(Service): path=path, context=context ).close() - else: + elif path not in sent: child.call_service_async( service_name=self.name(), method_name='store_and_forward', @@ -642,6 +642,7 @@ class PushFileService(Service): data=self._cache[path], context=context ).close() + sent.add(path) @expose(policy=AllowParents()) @arg_spec({