# Support for task timeouts with stdout/stderr

**URL:** <https://forum.ansible.com/t/support-for-task-timeouts-with-stdout-stderr/12984>\
**Category:** Ansible Project\
**Created:** [June 19, 2013, 2:48am UTC](https://forum.ansible.com/t/support-for-task-timeouts-with-stdout-stderr/12984 "2013-06-19T02:48:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lorin\_Hochstein1](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@Lorin\_Hochstein1](https://forum.ansible.com/u/Lorin_Hochstein1)\
**Post date:** [June 19, 2013, 2:48am UTC](https://forum.ansible.com/t/support-for-task-timeouts-with-stdout-stderr/12984/1 "2013-06-19T02:48:03Z")

</div>

It would be tremendously useful if ansible supported timeouts for tasks, and if the task times out, then ansible outputs whatever was on stdout/stderr in the fail message.

I got bitten today because a django “manage.py migrate” command outputted the following message with a prompt:

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [June 19, 2013, 2:37pm UTC](https://forum.ansible.com/t/support-for-task-timeouts-with-stdout-stderr/12984/2 "2013-06-19T14:37:34Z")

</div>

async mode does in fact support a time-to-live for a task and will kill it after that time expires.

---

<div class="post-metadata">

**Author:** ![Lorin\_Hochstein1](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@Lorin\_Hochstein1](https://forum.ansible.com/u/Lorin_Hochstein1)\
**Post date:** [June 19, 2013, 2:45pm UTC](https://forum.ansible.com/t/support-for-task-timeouts-with-stdout-stderr/12984/3 "2013-06-19T14:45:57Z")

</div>

Does using async give you stdout/stderr of the task that got killed?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [June 19, 2013, 2:50pm UTC](https://forum.ansible.com/t/support-for-task-timeouts-with-stdout-stderr/12984/4 "2013-06-19T14:50:37Z")

</div>

Don’t think so.

Try it.

with a shell: echo hi; sleep 10 limiting the run time to 5 sec, perhaps 🙂

There are some needs to upgrade async, to support things like intermediate status.

---

<div class="post-metadata">

**Author:** ![Lorin\_Hochstein1](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@Lorin\_Hochstein1](https://forum.ansible.com/u/Lorin_Hochstein1)\
**Post date:** [June 23, 2013, 6:18pm UTC](https://forum.ansible.com/t/support-for-task-timeouts-with-stdout-stderr/12984/5 "2013-06-23T18:18:18Z")

</div>

You were right, no output on async timeout:

failed: [server1] =\> {“failed”: 1, “rc”: null}  
msg: timed out

FATAL: all hosts have already failed – aborting

Lorin
