# ssh connection\_plugin deadlock

**URL:** <https://forum.ansible.com/t/ssh-connection-plugin-deadlock/17939>\
**Category:** Ansible Developer\
**Created:** [April 9, 2015, 9:35am UTC](https://forum.ansible.com/t/ssh-connection-plugin-deadlock/17939 "2015-04-09T09:35:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaps](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shaps/32/1356_2.png) [@Shaps](https://forum.ansible.com/u/Shaps)\
**Post date:** [April 9, 2015, 9:35am UTC](https://forum.ansible.com/t/ssh-connection-plugin-deadlock/17939/1 "2015-04-09T09:35:53Z")

</div>

Hi,

I’ve been trying to figure out why that happens for almost 1 day now, but still cannot get to any solution.

I’m using the Runner to run the setup module against a set of servers, and it is defined this way:  
runner = Runner(  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;module\_name="setup",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;module\_args="",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inventory=inventory\_manager,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pattern=pattern,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;run\_hosts=run\_hosts,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo=True,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;forks=1,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeout=15  
&nbsp;&nbsp;&nbsp;&nbsp;)

This fails sometimes ( random, as far as I’ve seen ), sending a Traceback because i ssh plugin fails to get lock on the socket:

Traceback (most recent call last):\n File "/usr/lib/python2.6/site-packages/ansible/runner/\_\_init\_\_.py", line 590, in \_executor\n exec\_rc = self.\_executor\_internal(host, new\_stdin)\n File "/usr/lib/python2.6/site-packages/ansible/runner/\_\_init\_\_.py", line 793, in \_executor\_internal\n return self.\_executor\_internal\_inner(host, self.module\_name, self.module\_args, inject, port, complex\_args=complex\_args)\n File "/usr/lib/python2.6/site-packages/ansible/runner/\_\_init\_\_.py", line 962, in \_executor\_internal\_inner\n conn = self.connector.connect(actual\_host, actual\_port, actual\_user, actual\_pass, actual\_transport, actual\_private\_key\_file)\n File "/usr/lib/python2.6/site-packages/ansible/runner/connection.py", line 35, in connect\n conn = utils.plugins.connection\_loader.get(transport, self.runner, host, port, user=user, password=password, private\_key\_file=private\_key\_file)\n File "/usr/lib/python2.6/site-packages/ansible/utils/plugins.py", line 222, in get\n return getattr(self.\_module\_cache[path], self.class\_name)(\*args, \*\*kwargs)\n File "/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/ssh.py", line 51, in \_\_init\_\_\n fcntl.lockf(self.runner.process\_lockfile, fcntl.LOCK\_EX)\nIOError: [Errno 35] Resource deadlock avoided\n

The runner is working on 1 host at a time and it does not run concurrently on the same host.

Anyone has an idea on why that’s happening?

Thanks,

Andrea
