Skip to content

Commit 6775937

Browse files
committed
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.
1 parent 3c8c11b commit 6775937

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ansible_mitogen/process.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
u"__author__ = %r\n"
7373
)
7474

75+
MAX_MESSAGE_SIZE = 4096 * 1048576
76+
7577
worker_model_msg = (
7678
'Mitogen connection types may only be instantiated when one of the '
7779
'"mitogen_*" or "operon_*" strategies are active.'
@@ -502,6 +504,7 @@ def _reconnect(self, path):
502504
# with_items loops.
503505
raise ansible.errors.AnsibleError(shutting_down_msg % (e,))
504506

507+
self.router.max_message_size = MAX_MESSAGE_SIZE
505508
self.listener_path = path
506509

507510
def _on_process_exit(self):
@@ -692,7 +695,7 @@ def _setup_master(self):
692695
self.broker = mitogen.master.Broker(install_watcher=False)
693696
self.router = mitogen.master.Router(
694697
broker=self.broker,
695-
max_message_size=4096 * 1048576,
698+
max_message_size=MAX_MESSAGE_SIZE,
696699
)
697700
_setup_responder(self.router.responder)
698701
mitogen.core.listen(self.broker, 'shutdown', self._on_broker_shutdown)

0 commit comments

Comments
 (0)