From 67759371f9d2b85c922a973d3e31166cd207a5d3 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sat, 17 Aug 2019 03:19:32 +0100 Subject: [PATCH] issue #615: ensure 4GB max_message_size is configured for task workers. This 4GB limit was already set for MuxProcess and inherited by all descendents including the context running on the target host, but it was not applied to the WorkerProcess router. That explains why the error from the ticket is being raised by the router within the WorkerProcess rather than the router on the original target. --- ansible_mitogen/process.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ansible_mitogen/process.py b/ansible_mitogen/process.py index 503e9bb7..10d55fdf 100644 --- a/ansible_mitogen/process.py +++ b/ansible_mitogen/process.py @@ -72,6 +72,8 @@ ANSIBLE_PKG_OVERRIDE = ( u"__author__ = %r\n" ) +MAX_MESSAGE_SIZE = 4096 * 1048576 + worker_model_msg = ( 'Mitogen connection types may only be instantiated when one of the ' '"mitogen_*" or "operon_*" strategies are active.' @@ -502,6 +504,7 @@ class ClassicWorkerModel(WorkerModel): # with_items loops. raise ansible.errors.AnsibleError(shutting_down_msg % (e,)) + self.router.max_message_size = MAX_MESSAGE_SIZE self.listener_path = path def _on_process_exit(self): @@ -692,7 +695,7 @@ class MuxProcess(object): self.broker = mitogen.master.Broker(install_watcher=False) self.router = mitogen.master.Router( broker=self.broker, - max_message_size=4096 * 1048576, + max_message_size=MAX_MESSAGE_SIZE, ) _setup_responder(self.router.responder) mitogen.core.listen(self.broker, 'shutdown', self._on_broker_shutdown)