Hosting » AWS » What happens when AWS Lambda times out?

What happens when AWS Lambda times out?

Last updated on September 25, 2022 @ 6:28 pm

AWS Lambda is a compute service that enables developers to run code without having to provision or manage servers. Lambda functions can be triggered by events, such as a user hitting a button on a web page, or an application sending a signal.

Lambda functions are run in response to events, and are usually very short-lived. If a Lambda function times out, it is terminated and any code that was running in it is discarded.

This could lead to unexpected behavior in your application if you were relying on the function to perform a specific task.

PRO TIP: If your Lambda function is running longer than the configured timeout, it will be aborted and an error message will be logged.

When a Lambda function times out, AWS first tries to terminate the function using the normal termination mechanisms. If this fails, AWS attempts to kill the process using the process kill command.

If that fails, AWS terminates the process using the SIGKILL signal.

If a Lambda function times out, it is not possible to restart it. You might be able to retry the function after it has timed out, but AWS will not guarantee that the function will run again.

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.