# Ansible 1.9.4 playbook randomly stops running after async

**URL:** <https://forum.ansible.com/t/ansible-1-9-4-playbook-randomly-stops-running-after-async/20625>\
**Category:** Ansible Project\
**Created:** [February 19, 2016, 3:00am UTC](https://forum.ansible.com/t/ansible-1-9-4-playbook-randomly-stops-running-after-async/20625 "2016-02-19T03:00:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregory.gilbert](https://avatars.discourse-cdn.com/v4/letter/g/5f8ce5/32.png) [@gregory.gilbert](https://forum.ansible.com/u/gregory.gilbert)\
**Post date:** [February 19, 2016, 3:00am UTC](https://forum.ansible.com/t/ansible-1-9-4-playbook-randomly-stops-running-after-async/20625/1 "2016-02-19T03:00:18Z")

</div>

Hey. I’ve got this in my playbook:

- name: Fire async to watch build  
shell: “CONTAINER=my\_{{ timestamp }} /app/deploy/watch-docker.sh”  
async: 1200  
poll: 15  
register: watch\_docker  
ignore\_errors: true

- name: Wait until built  
async\_status:  
jid: “{{ watch\_docker.ansible\_job\_id }}”  
register: job\_result  
until: job\_result.finished  
retries: 100  
delay: 15  
ignore\_errors: true

and for some reason, after it passes the last action and goes onto the next ones, the script randomly stops working. No errors or anything, but the process just ends. It dies at different places, too, randomly on each host. The async poll usually takes about 7 minutes to run. I tried increasing the timeout on ansible.cfg to 30, but that did nothing either.

For reference, here’s the watch\_docker.sh that gets called:

#!/bin/bash  
if [! -z $CONTAINER]; then  
while true; do  
docker exec $CONTAINER pgrep php5-fpm  
catch=$?  
if [$catch -eq 0]; then  
break  
fi  
sleep 5  
done  
fi  
exit 0

I’m really at a loss as to what’s going on. Any ideas? Thanks!
