DEV Community

Karthik Sakthivel
Karthik Sakthivel

Posted on

AWS Lambda recursive loop detection can now automatically detect and stop recursive loops between AWS Lambda and Amazon S3

What's new at AWS πŸ“’

πŸ”” AWS Lambda recursive loop detection can now automatically detect and stop recursive loops between AWS Lambda and Amazon S3.

πŸ”” It would help us preventing unintended usage and billing from runaway workloads.

πŸ”” Customer misconfiguration or code defect can cause processed events to be sent back to the same Amazon S3(Source) bucket that invoked the Lambda function, causing unintended recursive loops.

πŸ”” With this launch, Lambda will automatically detect and stop such recursive loops and send customers an AWS Health Dashboard notification with troubleshooting steps.

πŸ₯ What is Lambda recursive loop detection:
βš•οΈ It is a preventative guardrail that automatically detects and stops recursive invocations between Lambda and other supported services.
βš•οΈ Importantly recursive loop detection is enabled by default.

πŸ₯ Supported AWS Services & SDKs:
πŸ”Ί Amazon S3
πŸ”Ί Amazon SQS
πŸ”Ί Amazon SNS
πŸ”Ί Node.js, Java, Python, .Net

πŸ₯ Important key note:
βš•οΈ If incase, Lambda function uses intentional recursive loops, you can use the PutFunctionRecursionConfig API to turn off recursive loop detection.
βš•οΈ When Lambda detects a recursive loop, it stops the function being invoked and notifies you, by default.
βš•οΈ You can a change a function's default configuration to allow.
βš•οΈ Lambda uses AWS X-Ray tracing header to detect recursive loops.

πŸ“Œ Explore the guide to enable Lambda recursive loop detection:
https://aws.amazon.com/blogs/compute/detecting-and-stopping-recursive-loops-in-aws-lambda-functions/

Top comments (0)