Update on AWS Lambda recursive loop detection feature
AWS Lambda is the quickest way to transform an idea into a present-day, production-ready serverless application. It is a compute service that maintains the compute resources automatically and runs your code in response to events.
It discovers how AWS’s comprehensive set of infrastructure capabilities and services enables rapid and cost-effective modern applications development.
AWS Lambda Recursive Loop Detection refers to the process of identifying and managing situations where an AWS Lambda function is involved in one or more recursive calls, either directly (the function calls itself) or indirectly (the function is invoked by another function that eventually leads to the original function).
Recursive loop detection identifies and stops recursive loops involving AWS Lambda and other supported services, preventing uncontrolled workloads that may arise from misconfigurations. Currently, this feature supports detecting loops between AWS Lambda, Amazon SQS, and Amazon SNS. In 2024, AWS Lambda will expand this feature to include Amazon S3. As a preliminary phase before the complete rollout of this enhancement, AWS Lambda will be updating the mechanisms used for detecting recursive loops.
Starting July 8, 2024, AWS Lambda will terminate recursive invocations that involve interactions between Lambda and S3, where S3 is not the direct event source or trigger for the Lambda function. This termination will occur after approximately 16 recursive invocations. An example scenario that will now trigger termination involves a Lambda function storing data in an S3 bucket, which then triggers notifications to SNS, subsequently invoking the same Lambda function again. This update will be gradually implemented throughout June across all commercial regions where recursive loop detection is currently supported. Note that recursive loop detection is not currently available in the following commercial regions: Middle East (UAE), Asia Pacific (Hyderabad), Asia Pacific (Melbourne), Israel (Tel Aviv), Canada West (Calgary), Europe (Spain), and Europe (Zurich).
Action to be taken
If your function uses deliberate recursion with Amazon S3, you should reach out to AWS Support [1] to request an exemption from recursive loop detection to prevent any potential disruption to your workload. Please submit a support case for each affected account and specify the region where the opt-out is needed.