<p dir="auto">When I run ansible-playbook on HEAD, I get the following traceback:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK: [Check known pacnews] ***************************************************
ok: [grego] =&gt; (item={'path': '/etc/fstab', 'old': '4ebaee2c67a0e6df3def1fbd8ce5194d07ca6546', 'new': 'a805082718eb9814229968ab11be76a8d34d6033', 'keep': 'old'})
changed: [grego] =&gt; (item={'path': '/etc/pacman.d/mirrorlist', 'old': '162f45764216fe0cc2697c5ca63f901032f26ea6', 'new': 'ANY', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/etc/shadow', 'old': 'ANY', 'new': 'e0d59e5430b4dd9c6ed721e29de450487d4ad89f', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/etc/gshadow', 'old': '1dbb1d43b8c1854898589bb6d1ea92d49be508c6', 'new': 'c96a71de4466893f090905f536f418ddac708e71', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/etc/passwd', 'old': '110262be0777e00239aa9413eba1bd9f8e82e84c', 'new': '5db8ef768aa79940d0c28347ebfa8755cfb53920', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/etc/group', 'old': 'fe85b1c169d6ecff70868e05d762dd7528f65e7c', 'new': '27d785a76a1e5c61f691ce2bbc3cbe441310b7c2', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/etc/locale.gen', 'old': '13d6ce49547f3bd457364983fab74b254569dd90', 'new': '5672ef37a399b86ef417fa42155777e93840dd53', 'keep': 'new'})
ok: [grego] =&gt; (item={'path': '/etc/pacman.conf', 'old': 'd5825b3d61c7e71f16c8790af1cb0a2c429bbff6', 'new': '3c1bddf27602e02fb57801c0ea7313b3869acc92', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/boot/grub/grub.cfg', 'old': 'NONE', 'new': '5b7fcb0718a23035c039eb2fda9e088bb13ae611', 'keep': 'new'})
ok: [grego] =&gt; (item={'path': '/etc/mkinitcpio.conf', 'old': '67ca9a323c979ee93c4c1a5592b02c89564d630e', 'new': 'c27c0ae5797582f47f8db1368fc730658c8d4cfe', 'keep': 'new'})
fatal: [grego] =&gt; Traceback (most recent call last):
  File &quot;/usr/local/brew/lib/python2.7/site-packages/ansible/runner/__init__.py&quot;, line 368, in _executor
    exec_rc = self._executor_internal(host, new_stdin)
  File &quot;/usr/local/brew/lib/python2.7/site-packages/ansible/runner/__init__.py&quot;, line 481, in _executor_internal
    complex_args=complex_args
  File &quot;/usr/local/brew/lib/python2.7/site-packages/ansible/runner/__init__.py&quot;, line 612, in _executor_internal_inner
    tmp = self._make_tmp_path(conn)
  File &quot;/usr/local/brew/lib/python2.7/site-packages/ansible/runner/__init__.py&quot;, line 736, in _make_tmp_path
    result = self._low_level_exec_command(conn, cmd, None, sudoable=False)
  File &quot;/usr/local/brew/lib/python2.7/site-packages/ansible/runner/__init__.py&quot;, line 671, in _low_level_exec_command
    rc, stdin, stdout, stderr = conn.exec_command(cmd, tmp, sudo_user, sudoable=sudoable, executable=executable)
  File &quot;/usr/local/brew/lib/python2.7/site-packages/ansible/runner/connection_plugins/ssh.py&quot;, line 165, in exec_command
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File &quot;/usr/local/brew/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py&quot;, line 703, in __init__
    errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File &quot;/usr/local/brew/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py&quot;, line 1120, in _get_handles
    errread, errwrite = self.pipe_cloexec()
  File &quot;/usr/local/brew/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py&quot;, line 1153, in pipe_cloexec
    r, w = os.pipe()
OSError: [Errno 24] Too many open files"><pre class="notranslate"><code class="notranslate">TASK: [Check known pacnews] ***************************************************
ok: [grego] =&gt; (item={'path': '/etc/fstab', 'old': '4ebaee2c67a0e6df3def1fbd8ce5194d07ca6546', 'new': 'a805082718eb9814229968ab11be76a8d34d6033', 'keep': 'old'})
changed: [grego] =&gt; (item={'path': '/etc/pacman.d/mirrorlist', 'old': '162f45764216fe0cc2697c5ca63f901032f26ea6', 'new': 'ANY', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/etc/shadow', 'old': 'ANY', 'new': 'e0d59e5430b4dd9c6ed721e29de450487d4ad89f', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/etc/gshadow', 'old': '1dbb1d43b8c1854898589bb6d1ea92d49be508c6', 'new': 'c96a71de4466893f090905f536f418ddac708e71', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/etc/passwd', 'old': '110262be0777e00239aa9413eba1bd9f8e82e84c', 'new': '5db8ef768aa79940d0c28347ebfa8755cfb53920', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/etc/group', 'old': 'fe85b1c169d6ecff70868e05d762dd7528f65e7c', 'new': '27d785a76a1e5c61f691ce2bbc3cbe441310b7c2', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/etc/locale.gen', 'old': '13d6ce49547f3bd457364983fab74b254569dd90', 'new': '5672ef37a399b86ef417fa42155777e93840dd53', 'keep': 'new'})
ok: [grego] =&gt; (item={'path': '/etc/pacman.conf', 'old': 'd5825b3d61c7e71f16c8790af1cb0a2c429bbff6', 'new': '3c1bddf27602e02fb57801c0ea7313b3869acc92', 'keep': 'old'})
ok: [grego] =&gt; (item={'path': '/boot/grub/grub.cfg', 'old': 'NONE', 'new': '5b7fcb0718a23035c039eb2fda9e088bb13ae611', 'keep': 'new'})
ok: [grego] =&gt; (item={'path': '/etc/mkinitcpio.conf', 'old': '67ca9a323c979ee93c4c1a5592b02c89564d630e', 'new': 'c27c0ae5797582f47f8db1368fc730658c8d4cfe', 'keep': 'new'})
fatal: [grego] =&gt; Traceback (most recent call last):
  File "/usr/local/brew/lib/python2.7/site-packages/ansible/runner/__init__.py", line 368, in _executor
    exec_rc = self._executor_internal(host, new_stdin)
  File "/usr/local/brew/lib/python2.7/site-packages/ansible/runner/__init__.py", line 481, in _executor_internal
    complex_args=complex_args
  File "/usr/local/brew/lib/python2.7/site-packages/ansible/runner/__init__.py", line 612, in _executor_internal_inner
    tmp = self._make_tmp_path(conn)
  File "/usr/local/brew/lib/python2.7/site-packages/ansible/runner/__init__.py", line 736, in _make_tmp_path
    result = self._low_level_exec_command(conn, cmd, None, sudoable=False)
  File "/usr/local/brew/lib/python2.7/site-packages/ansible/runner/__init__.py", line 671, in _low_level_exec_command
    rc, stdin, stdout, stderr = conn.exec_command(cmd, tmp, sudo_user, sudoable=sudoable, executable=executable)
  File "/usr/local/brew/lib/python2.7/site-packages/ansible/runner/connection_plugins/ssh.py", line 165, in exec_command
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/local/brew/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 703, in __init__
    errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File "/usr/local/brew/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1120, in _get_handles
    errread, errwrite = self.pipe_cloexec()
  File "/usr/local/brew/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1153, in pipe_cloexec
    r, w = os.pipe()
OSError: [Errno 24] Too many open files
</code></pre></div>
<p dir="auto">Here's that task:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="-   name: Check known pacnews
    pacnew: &gt;
        path={{item.path}}
        new={{item.new}}
        old={{item.old}}
        keep={{item.keep}}
    with_items: pacnews"><pre class="notranslate"><code class="notranslate">-   name: Check known pacnews
    pacnew: &gt;
        path={{item.path}}
        new={{item.new}}
        old={{item.old}}
        keep={{item.keep}}
    with_items: pacnews
</code></pre></div>
<p dir="auto">It's using my pacnew module: <a href="https://github.com/akerl/archer/blob/master/library/pacnew">https://github.com/akerl/archer/blob/master/library/pacnew</a></p>
<p dir="auto">The full plays and such are here:<br>
<a href="https://github.com/akerl/archer">https://github.com/akerl/archer</a></p>
<p dir="auto">I traced this issue down to <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/4d1f4479083e87e97419fb554a943dafadce00d5/hovercard" href="https://github.com/ansible/ansible/commit/4d1f4479083e87e97419fb554a943dafadce00d5"><tt>4d1f447</tt></a>, and confirmed it doesn't occur in <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/baffa8df726440b1dc4ea700d1f4758988cdbf3d/hovercard" href="https://github.com/ansible/ansible/commit/baffa8df726440b1dc4ea700d1f4758988cdbf3d"><tt>baffa8d</tt></a>. My test runs are here:</p>
<p dir="auto"><a href="https://gist.github.com/akerl/6584034">https://gist.github.com/akerl/6584034</a></p>
<p dir="auto">Somebody in #ansible suggested I use "-f 1", which I tried; the issue was the same. That run is in the gist as well.</p>
<p dir="auto">It seems some recent changes has introduced this regression, this occurs on OSX 10.7, bumping up the limits by "ulimit -n 2048" works around the problem. There might just be some file descriptors/pipes not being closed. You could limit the loop (wherever its happening) for the subprocesses to be just 1024?</p>
<p dir="auto">I might poke around if I have time. For now the above is a bug report!</p>
<pre class="notranslate">TASK: [clone {{host_group}} code - private head] ******************************
fatal: [10.0.1.200] =&gt; Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/runner/__init__.py", line 368, in _executor
    exec_rc = self._executor_internal(host, new_stdin)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/runner/__init__.py", line 455, in _executor_internal
    return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/runner/__init__.py", line 612, in _executor_internal_inner
    tmp = self._make_tmp_path(conn)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/runner/__init__.py", line 736, in _make_tmp_path
    result = self._low_level_exec_command(conn, cmd, None, sudoable=False)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/runner/__init__.py", line 671, in _low_level_exec_command
    rc, stdin, stdout, stderr = conn.exec_command(cmd, tmp, sudo_user, sudoable=sudoable, executable=executable)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/runner/connection_plugins/ssh.py", line 165, in exec_command
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 703, in __init__
    errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1120, in _get_handles
    errread, errwrite = self.pipe_cloexec()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1153, in pipe_cloexec
    r, w = os.pipe()
OSError: [Errno 24] Too many open files


FATAL: all hosts have already failed -- aborting
</pre>