diff --git a/ansible_mitogen/connection.py b/ansible_mitogen/connection.py index 8bfbb51d..28afb099 100644 --- a/ansible_mitogen/connection.py +++ b/ansible_mitogen/connection.py @@ -44,6 +44,7 @@ import ansible.errors import ansible.plugins.connection import ansible.utils.shlex +import mitogen.core import mitogen.fork import mitogen.unix import mitogen.utils @@ -340,12 +341,21 @@ CONNECTION_METHOD = { } +class Broker(mitogen.master.Broker): + """ + WorkerProcess maintains at most 2 file descriptors, therefore does not need + the exuberant syscall expense of EpollPoller, so override it and restore + the poll() poller. + """ + poller_class = mitogen.core.Poller + + class CallChain(mitogen.parent.CallChain): """ Extend :class:`mitogen.parent.CallChain` to additionally cause the associated :class:`Connection` to be reset if a ChannelError occurs. - This only catches failures that occur while a call is pnding, it is a + This only catches failures that occur while a call is pending, it is a stop-gap until a more general method is available to notice connection in every situation. """ diff --git a/docs/changelog.rst b/docs/changelog.rst index e4458dc5..fa61ef0f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -174,6 +174,7 @@ Enhancements latency. * `#415 `_, + `#491 `_, `#493 `_: the interface employed for in-process queues changed from `kqueue `_ / `epoll