# Timeout waiting for agent

**URL:** <https://forum.buildkite.community/t/timeout-waiting-for-agent/188>\
**Category:** Features Requests\
**Created:** [December 31, 2018, 6:55pm UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188 "2018-12-31T18:55:04Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathan.pierce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/nathan.pierce/32/393_2.png) [@nathan.pierce](https://forum.buildkite.community/u/nathan.pierce)\
**Post date:** [December 31, 2018, 6:55pm UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/1 "2018-12-31T18:55:04Z")

</div>

We had an issue recently where our agents weren’t starting and the jobs were sitting around for days waiting on agents. While we can setup monitoring for this, I’d love to have an option to timeout on waiting for agents.

---

<div class="post-metadata">

**Author:** ![Keith](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/keith/32/592_2.png) [@Keith](https://forum.buildkite.community/u/Keith)\
**Post date:** [July 2, 2019, 9:18pm UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/2 "2019-07-02T21:18:08Z")

</div>

This would be a great feature to have, we occasionally update tool versions that are in the tags, and if people try to run builds on older branches, we don’t discover for a while that some builds have just been waiting forever

---

<div class="post-metadata">

**Author:** ![spark](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/spark/32/852_2.png) [@spark](https://forum.buildkite.community/u/spark)\
**Post date:** [September 13, 2020, 12:43am UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/3 "2020-09-13T00:43:06Z")

</div>

Echoing this sentiment. There’s already a [`timeout_in_minutes`](https://buildkite.com/docs/pipelines/command-step#command-step-attributes) that limits a job run time after it’s running. I’d suggest either including agent-matching time in this or specifying a new configuration value (like `agent_assignment_timeout_in_minutes`).

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/simonbyrne/32/847_2.png) [@simonbyrne](https://forum.buildkite.community/u/simonbyrne)\
**Post date:** [October 4, 2022, 6:25pm UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/4 "2022-10-04T18:25:01Z")

</div>

Me too, would be very helpful for working with experimental agents (e.g. new hardware) which not always be online.

---

<div class="post-metadata">

**Author:** ![jeremy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/jeremy/32/1040_2.png) [@jeremy](https://forum.buildkite.community/u/jeremy)\
**Post date:** [October 4, 2022, 6:51pm UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/5 "2022-10-04T18:51:04Z")

</div>

Hi @simonbyrne we recently implemented default timeouts on all jobs, [Default timeouts for command steps](https://buildkite.com/changelog/161-default-timeouts-for-command-steps), which you can specify at the organization level on your organization’s [Pipeline Settings Page](https://buildkite.com/organizations/~/pipeline-settings)

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/simonbyrne/32/847_2.png) [@simonbyrne](https://forum.buildkite.community/u/simonbyrne)\
**Post date:** [October 4, 2022, 7:08pm UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/6 "2022-10-04T19:08:40Z")

</div>

@jeremy That doesn’t appear to limit the wait time though?

---

<div class="post-metadata">

**Author:** ![jeremy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/jeremy/32/1040_2.png) [@jeremy](https://forum.buildkite.community/u/jeremy)\
**Post date:** [October 4, 2022, 9:28pm UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/7 "2022-10-04T21:28:28Z")

</div>

@simonbyrne my apologies! You’re absolutely correct - timeouts on jobs waiting for an agent still aren’t possible. I’ll pass this feedback along to the team though, as I think it would still be a great thing to have.

---

<div class="post-metadata">

**Author:** ![sj26](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/sj26/32/17_2.png) [@sj26](https://forum.buildkite.community/u/sj26)\
**Post date:** [October 7, 2022, 6:55am UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/8 "2022-10-07T06:55:58Z")

</div>

Hi folks!

There is a global limit of 30 days:

> **[Automatic job expiration after 30 days](https://buildkite.com/changelog/157-automatic-job-expiration-after-30-days)**
>
> Starting August 1st 2022, jobs which are not run within 30 days will automatically expire 🧹

We built it in a way that might be customisable in future, but it isn’t yet sorry.

---

<div class="post-metadata">

**Author:** ![spaul](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@spaul](https://forum.buildkite.community/u/spaul)\
**Post date:** [November 14, 2022, 2:07am UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/9 "2022-11-14T02:07:26Z")

</div>

Anyone choosing to run their agents on spot instances and running any sort of agent maintenance routines is vulnerable to a particularly annoying version of this issue – namely where you schedule things for specific EC2 identifiers (that then get reclaimed), leading to jobs that go on for days.

+1 for introducing a agent allocation timeout. +2 if we can monitor that metric on a account wide basis and setup alerting in crossing some thresholds.

---

<div class="post-metadata">

**Author:** ![benmc](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/benmc/32/1159_2.png) [@benmc](https://forum.buildkite.community/u/benmc)\
**Post date:** [November 14, 2022, 2:35am UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/10 "2022-11-14T02:35:58Z")

</div>

Hey @spaul!

Welcome to the community and thanks for your message!

As Sam mentioned above, we have note that customising this time frame is desired, but it’s not something we’re able to work on right now.

Re: metrics, this too is something we’re keeping an eye on. Have you investigated setting up your own alerting in AWS, or another cloud provider? Utilising services such as EventBridge and Lambda to measure agent events?

Cheers,

Ben

---

<div class="post-metadata">

**Author:** ![pme](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/pme/32/711_2.png) [@pme](https://forum.buildkite.community/u/pme)\
**Post date:** [April 25, 2023, 6:13pm UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/11 "2023-04-25T18:13:49Z")

</div>

I could use this feature too.

I’m building the AWS AMIs in buildkite, and have steps to spin up a new instance using the new AMI, and then run a job on it to verify that it actually works. Today it failed (got stuck waiting for the agent to come online) as resizing the disk failed and the instance got wedged.

---

<div class="post-metadata">

**Author:** ![suma](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/suma/32/1306_2.png) [@suma](https://forum.buildkite.community/u/suma)\
**Post date:** [April 25, 2023, 9:36pm UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/12 "2023-04-25T21:36:30Z")

</div>

Hi @pme

Thank you for the feedback and sharing your interest in this feature request. At the moment we do have an open feature request for this but it is not part of our immediate roadmap. I shared your feedback with our product team on this request.

Thanks,  
Suma

---

<div class="post-metadata">

**Author:** ![Ozdenyilmaz](https://avatars.discourse-cdn.com/v4/letter/o/f08c70/32.png) [@Ozdenyilmaz](https://forum.buildkite.community/u/Ozdenyilmaz)\
**Post date:** [May 2, 2023, 3:18am UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/13 "2023-05-02T03:18:36Z")

</div>

Hi everyone,

I am from the product team at Buildkite. Thanks for raising the feedback. As @suma said, it is not in our immediate roadmap.

However I just wanted to jump in and ask some questions.

- The first one is about the 30 day limit. Is that too long? Would you rather have a shorter global limit? If yes how would you define this?
- Secondly, do you have timelines that require a shorter timeout and some that require a longer timeout?

Thanks,  
Oz

---

<div class="post-metadata">

**Author:** ![rcheu](https://avatars.discourse-cdn.com/v4/letter/r/a698b9/32.png) [@rcheu](https://forum.buildkite.community/u/rcheu)\
**Post date:** [November 27, 2023, 5:41pm UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/14 "2023-11-27T17:41:29Z")

</div>

The 30 day limit seems far too long, in most cases something is wrong if there’s no agent within a few hours.

Would prefer a much shorter timeout for optional steps, ex. those with soft\_fail enabled. It’d be best if this was configurable per step, just like the normal timeout.

---

<div class="post-metadata">

**Author:** ![stephanie.atte](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/stephanie.atte/32/1357_2.png) [@stephanie.atte](https://forum.buildkite.community/u/stephanie.atte)\
**Post date:** [November 27, 2023, 6:29pm UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/15 "2023-11-27T18:29:52Z")

</div>

Hey @rcheu

Welcome to our Forum!

This feature is on the roadmap for next year, we are going to make the timeout 7days and we would send comms out when this is done.

Cheers!

---

<div class="post-metadata">

**Author:** ![Ozdenyilmaz](https://avatars.discourse-cdn.com/v4/letter/o/f08c70/32.png) [@Ozdenyilmaz](https://forum.buildkite.community/u/Ozdenyilmaz)\
**Post date:** [December 13, 2023, 4:24am UTC](https://forum.buildkite.community/t/timeout-waiting-for-agent/188/16 "2023-12-13T04:24:03Z")

</div>

Hi everyone,

We just released out a setting which lets you configure a shorter timeout for scheduled jobs for your organisation. You can read about it [here](https://buildkite.com/docs/pipelines/build-timeouts#scheduled-job-expiry).

Let us know if you have questions.

Have a great day!
