Skip to content

Commit 4996ec2

Browse files
moreatilberrutiphilfry
committed
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 <[email protected]> Co-authored-by: Philippe Kueck <[email protected]>
1 parent efdd82d commit 4996ec2

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

ansible_mitogen/process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,11 @@ def get_cpu_count(default=None):
281281

282282
class Broker(mitogen.master.Broker):
283283
"""
284-
WorkerProcess maintains at most 2 file descriptors, therefore does not need
284+
WorkerProcess maintains fewer file descriptors, therefore does not need
285285
the exuberant syscall expense of EpollPoller, so override it and restore
286286
the poll() poller.
287287
"""
288-
poller_class = mitogen.core.Poller
288+
poller_class = mitogen.parent.POLLER_LIGHTWEIGHT
289289

290290

291291
class Binding(object):

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Unreleased
2222
----------
2323

2424
* :gh:issue:`952` Fix Ansible `--ask-become-pass`, add test coverage
25+
* :gh:issue:`957` Fix Ansible exception when executing against 10s of hosts
26+
"ValueError: filedescriptor out of range in select()"
2527

2628

2729
v0.3.7 (2024-04-08)

docs/contributors.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@ sponsorship and outstanding future-thinking of its early adopters.
126126
<li>jgadling</li>
127127
<li>John F Wall &mdash; <em>Making Ansible Great with Massive Parallelism</em></li>
128128
<li>KennethC</li>
129+
<li><a href="https://github.com/lberruti">Luca Berruti</li>
129130
<li>Lewis Bellwood &mdash; <em>Happy to be apart of a great project.</em></li>
130131
<li>luto</li>
131132
<li><a href="https://mayeu.me/">Mayeu a.k.a Matthieu Maury</a></li>
132133
<li><a href="https://twitter.com/nathanhruby">@nathanhruby</a></li>
133134
<li><a href="https://github.com/opoplawski">Orion Poplawski</a></li>
135+
<li><a href="https://github.com/philfry">Philippe Kueck</a></li>
134136
<li><a href="http://pageflows.com/">Ramy</a></li>
135137
<li>Scott Vokes</li>
136138
<li><a href="https://twitter.com/sirtux">Tom Eichhorn</a></li>

0 commit comments

Comments
 (0)