This topic describes the retry mechanism for functions upon failed synchronous or asynchronous invocations.

## Retry mechanism

If a function fails to be executed, its invocation method determines whether Function Compute automatically retries the function.

- Failed synchronous invocation
Function Compute does not automatically retry the function. You can manually retry the function.

- Failed asynchronous invocation
In the following situations, Function Compute automatically retries the function.
Failure cause HTTP status code Server behavior Billable Solution An error of the `HandledInvocationError`

or`UnhandledInvocationError`

type in Function Compute occurs. For more information about the error types in Function Compute, see Basics.200 By default, Function Compute retries the function a maximum of three times. You can change this setting as needed. Billed based on the number of invocations. For more information, see Billing overview. Troubleshoot your code. Execution concurrency exceeds the upper limit. 429 Function Compute retries the function for up to 5 hours in binary exponential backoff mode. Function Compute starts to retry a function 0.5 seconds after the function fails to be executed. The subsequent retries are performed at binary exponential back-off intervals, such as 1 second, 2 seconds, 4 seconds, and 8 seconds. No By default, the maximum number of on-demand instances allowed for your Alibaba Cloud account in each region is 300. If you want to increase the upper limit, join the DingTalk group **11721331**to contact the technical support.An internal system error occurs. 500 Function Compute retries the function for up to 5 hours in binary exponential backoff mode. Function Compute starts to retry a function 0.5 seconds after the function fails to be executed. The subsequent retries are performed at binary exponential back-off intervals, such as 1 second, 2 seconds, 4 seconds, and 8 seconds. No Join the DingTalk group **11721331**to contact the technical support.Function Compute resources are insufficient. 503 Function Compute retries the function for up to 5 hours in binary exponential backoff mode. Function Compute starts to retry a function 0.5 seconds after the function fails to be executed. The subsequent retries are performed at binary exponential back-off intervals, such as 1 second, 2 seconds, 4 seconds, and 8 seconds. No Join the DingTalk group **11721331**to contact the technical support.

If you encounter problems, you can contact Function Compute engineers.