0


I had a few questions about AWS lambdas and I couldn't find much details in the documentation
How can I increase the number of retries in AWS Lambda?
In case the maximum number of retries have occurred and whole Lambda has failed how can I get some sort of a notification?

Venkat Dabri
  • 31
  • 2
  • 6

1 Answers1

0

Lambda retries are based upon many factors. I suggest you take a look into the official docs to understand every single type of retry, but long story short:

  1. Stream-Based Synchronous Event sources can either retry or not. It depends on the Service.
  2. Asynchronous Event sources will retry up to three times. If all messages fail, you can then configure a DLQ to receive the failed messages
  3. (Stream-Based && Poll-Based Event Sources) (like Kinesis or Dynamo) will retry until the configured data retention. Be careful because if one message fails and the message itself is poisonous, it will keep retrying until it expires and no new messages will be processed
  4. (Non-Stream-Based && Poll-Based Event Sources) (SQS) will discard messages in case of failure (unless it was an invocation failure or a timeout). If discarded, they will be sent to a DLQ if you previously configured one.

So, based on the information above, we can then tackle your question around notifications: you can have another Lambda subscribed to your DLQ to receive the message and notify the way you want. Either by sending an e-mail from the function itself or sending it to SNS (to possibly send an e-mail directly or do whatever you want with it).

For the retry amount, that's not configurable for the already built-in values. The furthest you can go is to invoke a Lambda function synchronously from your code and, in case of exception, retry it as you wish (the exponential backoff, if desired, would also need to be coded manually)

Thales Minussi
  • 6,965
  • 1
  • 30
  • 48