Debugging hang at the end of a playbook run

Often (but not always) when I run ansible-playbook with one of my playbooks, the entire thing will seem to run successfully, but at the very end of the run (after printing the PLAY RECAP section) it hangs rather than exiting and returning to the shell. I’ve tried leaving it for ~30 minutes and it seems to hang forever.

If I look at the running processes, I see there are two Python processes continuing to run, one parent and one child.

If I press control-C, I get a Traceback like the following:

^CTraceback (most recent call last):

File “/Users/tim/src/cultureamp-ansible-playbooks/venv/lib/python2.7/site-packages/ansible/executor/process/result.py”, line 104, in run

time.sleep(0.0001)

File “/Users/tim/src/cultureamp-ansible-playbooks/venv/lib/python2.7/site-packages/ansible/executor/playbook_executor.py”, line 199, in _cleanup

return self._tqm.cleanup()

File “/Users/tim/src/cultureamp-ansible-playbooks/venv/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py”, line 245, in cleanup

self._cleanup_processes()

File “/Users/tim/src/cultureamp-ansible-playbooks/venv/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py”, line 249, in _cleanup_processes

self._result_prc.terminate()

File “/Users/tim/src/cultureamp-ansible-playbooks/venv/lib/python2.7/site-packages/ansible/executor/process/result.py”, line 89, in terminate

super(ResultProcess, self).terminate()

File “/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py”, line 137, in terminate

self._popen.terminate()

AttributeError: ‘NoneType’ object has no attribute ‘terminate’

Is this a bug in Ansible? Is there anything else I should do to help diagnose this?

Here’s some more information about my system:

$ ansible-playbook --version

ansible-playbook 2.0.0.2

config file = /Users/tim/src/cultureamp-ansible-playbooks/ansible.cfg

configured module search path = ./library

$ python --version

Python 2.7.11

$ uname -a

Darwin Tim-Culture-Amp.local 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64

Mac OS X 10.11.2 (15C50)

Thanks,

Tim Moore