The init phase is limited to 10 seconds, although, after the first 10 seconds we should retry it. The init phase is anything happening outsize the handler. Are you doing anything intensive in there? If you do, I suggest you move it into the handler.
You did not mention how you trigger the function. For example, if you trigger it from SQS, it may be that your visibility timeout is too low, so the function may be triggered more than once. Also, SQS has an At Least once lambda invocation, so by design your function may be invoked twice.
If idempotancy is important for your use case, you may need to implement it into your function by marking tha batch when it is being processed. You can mark it in a DynamoDB table for instancee
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- What's the difference between Lambda function execution role permissions and invocation permissions?AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- EXPERTpublished 2 years ago
- EXPERTpublished 8 months ago