# Background function retries

**URL:** <https://answers.netlify.com/t/background-function-retries/39459>\
**Category:** Support\
**Tags:** lambda-functions\
**Created:** [June 15, 2021, 6:58pm UTC](https://answers.netlify.com/t/background-function-retries/39459 "2021-06-15T18:58:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlana](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/carlana/32/62504_2.png) [@carlana](https://answers.netlify.com/u/carlana)\
**Post date:** [June 15, 2021, 6:58pm UTC](https://answers.netlify.com/t/background-function-retries/39459/1 "2021-06-15T18:58:27Z")

</div>

The docs for background functions say:

> If function execution returns an error, AWS will retry the execution after one minute. If it fails again, another retry happens two minutes later.

So is the limit for retries 2? Or will it keep retrying after that? What status codes are retried? In a quick test, it looks like 404 are not retried. Does it need to be in the 5xx range?

---

<div class="post-metadata">

**Author:** ![Scott](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/scott/32/26136_2.png) [@Scott](https://answers.netlify.com/u/Scott)\
**Post date:** [June 15, 2021, 10:49pm UTC](https://answers.netlify.com/t/background-function-retries/39459/2 "2021-06-15T22:49:06Z")

</div>

Hey!

> So is the limit for retries 2?

I believe that’s right, yes.

> What status codes are retried?

None! We’ll only automatically retry if we observe an **unhandled** exception.

A background function will always return a `202`, by the way. It’s executed async!

---

<div class="post-metadata">

**Author:** ![carlana](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/carlana/32/62504_2.png) [@carlana](https://answers.netlify.com/u/carlana)\
**Post date:** [June 16, 2021, 1:45pm UTC](https://answers.netlify.com/t/background-function-retries/39459/3 "2021-06-16T13:45:13Z")

</div>

My background functions are written in Go. Does this mean I need to panic to get a retry?

---

<div class="post-metadata">

**Author:** ![Scott](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/scott/32/26136_2.png) [@Scott](https://answers.netlify.com/u/Scott)\
**Post date:** [June 16, 2021, 3:46pm UTC](https://answers.netlify.com/t/background-function-retries/39459/4 "2021-06-16T15:46:18Z")

</div>

Oooh, good question. Now, my Go is somewhat lacking however yes – [a panic should essentially un-handle a handled exception](https://travix.io/unhandled-errors-in-go-3f341f2704dd), yes!
