More guidance on recursive loop detection for Lambda

0

Hello, we are looking to get some more information on Lambda recursive loop detection: https://docs.aws.amazon.com/lambda/latest/dg/invocation-recursion.html

We have a Cloudformation stack that deploys 2 Lambdas (1. Main, 2. Next) and 2 SQS (1. Main, 2. Next). We are using this stack to grab data from a 3rd party API which supports pagination headers. Hence, Main lambda gets triggered when a message in the Main sqs occurs and after the data is pulled from the API we send the pagination header as a message to the Next queue. This Next queue message triggers the Next Lambda which pulls the data based on pagination header and sends the new pagination header to the main queue.

This chain would cycle until there are no more pagination headers to pass through to the queues. However recently, because of this new feature, our lambda's stop working after 16th execution. Not sure why this is because the main lambda is not sending the message to Main sqs. In the docs it specifically states that it has to be the same lambda to send the message to the queue its attached to.

Another issue we noticed, the stack deployed in us-east-2 region doesn't adhere to recursive loop detection even though we have never asked the AWS support to disable this feature for us. Meanwhile the exact same stack deployed in us-east-1 does (Image below shows that lineage is way past the 16th execution and our lambda didn't stop in the us-east-2 region).

Is it possible to stop using this feature without messaging AWS support? If we decide to copy this stack to another region...we will have to message support again. Enter image description here

2 Answers
0

Hello.
If you have a Lambda that is looping by design, you will need to open a case with AWS support to have it disabled.

If your design intentionally uses recursive patterns, then you can request to turn off Lambda recursive loop detection. To request this change, contact AWS Support.

profile picture
EXPERT
answered 9 months ago
  • Thanks Riku. Just wondering if there is another way because messaging support becomes tedious? Also, why does loop detection not work for one stack compared to other when its exactly the same stack but different region? More importantly, why is this an issue when the lambda sending the message to a queue is completely different?

  • I have searched on the management console and do not see an option to disable it. I am not sure of the details since I have not been able to see your actual environment, but I suspect that you have a looping configuration. Are you calling Lambda from the same SNS as shown in the following figure? lambda

0

Thanks Riku. The stack diagram is attached. SNS is not involved.

Enter image description here

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions