Clarification on SQS Lambda integration backoff strategy for failed invocations

0

I've read the documentation inside and out and I still don't understand the mechanism behind the SQS Lambda integration backoff strategy for failed invocations.

For failures coming from function code it says that "if invocations continue to fail, Lambda eventually drops the message without retrying". Questions:

  • What is meant by "continue to fail"? How many times?
  • What is meant by "Lambda drops the message"?

From what I understand, and from what I was able to observe during my tests, is that when function code returns an error, the message is not deleted from the queue. Instead, it will be retried once its visibility timeout expires and the message becomes visible again. The number of retries is essentially governed by maxReceiveCount (if set), and the queue's message retention period.

For failures due to throttling (I assume Lambda throttling due to not enough available concurrency) it says that "Lambda continues to retry the message until the message's timestamp exceeds your queue's visibility timeout, at which point Lambda drops the message.". Questions:

  • Does it mean that if the invocation was throttled and a message is still invisible, Lambda will retry until the message is visible again?
  • How does it all relate to the recommendation that visibility timeout should be set to 6 times the function's timeout? Why is it 6 times, and why is it tied to the function timeout? If my function timeout is 10 minutes, why should the visibility timeout be 1 hour?

I feel like some important details are omitted in the documentation that makes it difficult to understand the exact mechanism. Much appreciation to anyone who can clarify this for me!

Nessuna risposta

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande