When a client actively cancels a request, Function Compute considers the current instance to be unhealthy and starts a new instance. The current instance is stopped after the new instance is started.
You can configure a health check policy to prevent instances from being restarted. For more information, see Step 2: Configure a health check policy for instances. After you configure the health check policy, the instance does not restart even if a 499 error is reported when a client actively cancels a request. For more information about how to configure limits and health check behavior for instance health check, see Configure a custom health check policy for instances.