From 4996ec2f09ad31a46a2b4e03cf1e765fc0e830d5 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Fri, 19 Apr 2024 10:39:49 +0100 Subject: [PATCH] ansible_mitogen: Fix "filedescriptor out of range in select()" in WorkerProcess `mitogen.parent.POLLER_LIGHTWEIGHT` will normally be `PollPoller`, falling back to `EpollPoller`, `KqueuePoller`, or `Poller`. Fixes #957 Co-authored-by: Luca Berruti Co-authored-by: Philippe Kueck --- ansible_mitogen/process.py | 4 ++-- docs/changelog.rst | 2 ++ docs/contributors.rst | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ansible_mitogen/process.py b/ansible_mitogen/process.py index 63caa88a..3a41a43d 100644 --- a/ansible_mitogen/process.py +++ b/ansible_mitogen/process.py @@ -281,11 +281,11 @@ def get_cpu_count(default=None): class Broker(mitogen.master.Broker): """ - WorkerProcess maintains at most 2 file descriptors, therefore does not need + WorkerProcess maintains fewer 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 + poller_class = mitogen.parent.POLLER_LIGHTWEIGHT class Binding(object): diff --git a/docs/changelog.rst b/docs/changelog.rst index bcf6d01e..407a8c78 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -22,6 +22,8 @@ Unreleased ---------- * :gh:issue:`952` Fix Ansible `--ask-become-pass`, add test coverage +* :gh:issue:`957` Fix Ansible exception when executing against 10s of hosts + "ValueError: filedescriptor out of range in select()" v0.3.7 (2024-04-08) diff --git a/docs/contributors.rst b/docs/contributors.rst index 207e4d7b..ed7fef11 100644 --- a/docs/contributors.rst +++ b/docs/contributors.rst @@ -126,11 +126,13 @@ sponsorship and outstanding future-thinking of its early adopters.
  • jgadling
  • John F Wall — Making Ansible Great with Massive Parallelism
  • KennethC
  • +
  • Luca Berruti
  • Lewis Bellwood — Happy to be apart of a great project.
  • luto
  • Mayeu a.k.a Matthieu Maury
  • @nathanhruby
  • Orion Poplawski
  • +
  • Philippe Kueck
  • Ramy
  • Scott Vokes
  • Tom Eichhorn