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 Troubleshooting.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. 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 intervals for function retries are calculated based on the binary exponential backoff mode. The intervals for function retries are 1 second, 2 seconds, 4 seconds, and 8 seconds. The retry duration lasts 5 hours. No By default, the maximum number of on-demand instances allowed for your Alibaba Cloud account in each region is 300. To increase the limit, submit a ticket. 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 intervals for function retries are calculated based on the binary exponential backoff mode. The intervals for function retries are 1 second, 2 seconds, 4 seconds, and 8 seconds. The retry duration lasts 5 hours. No Submit a ticket. 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 intervals for function retries are calculated based on the binary exponential backoff mode. The intervals for function retries are 1 second, 2 seconds, 4 seconds, and 8 seconds. The retry duration lasts 5 hours. No Submit a ticket.

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