I am using a small piece of code to intentionally timeout lambda function
import json
import time
def lambda_handler(event, context):
time.sleep(5)
These are my lambda configuration -
The error I am getting after running this script -
But it is not retrying after timeout exception.
CodePudding user response:
Your problem seems to be that your SNS message has expired before the first retry can happen. Lambda retries happen at 1 minute and then a further 2 minutes later. Your configuration expires asynchronous events after 1 minute.
When using the default settings (6h max age, 2 retry attempts, no DLQ), your code works correctly and retries twice before failure.