All Products
Search
Document Center

Function Compute:How can I terminate a process in an infinite loop?

Last Updated:Aug 20, 2025

Infinite loops occur in two situations:
  • An infinite loop occurs within a single function.
  • Multiple functions invoke each other, resulting in infinite recursion. For example, function A invokes function B, which then invokes function A.

Scenario 1: When a function times out, the system automatically terminates the function and you receive a timeout error. However, no financial loss is incurred.

Scenario 2: You can set the maximum number of pay-as-you-go instances for the target function to 0. Function invocations are then terminated. For more information, see Overview of configuring the maximum number of on-demand instances.