When you invoke a function directly, you determine the strategy for handling errors. You can retry, send the event to a queue for debugging, or ignore the error. Your function’s code might have run completely, partially, or not at all. If you retry, ensure that your function’s code can handle the same event multiple times without causing duplicate transactions or other unwanted side effects.
When you invoke a function indirectly, you need to be aware of the retry behavior of the invoker and any service that the request encounters along the way.
For example, I did a test in my account. The flow is: upload a file to S3–>trigger lambda–>lambda access S3 and failed.
After uploading a file to S3 bucket, I can see there are 3 errors in Cloudwatch logs. That shows Lambda service retries function errors twice after first attempt fail.

So if you find single error in your lambda logs or error metric, you should not worry about these errors as the second attempt (retry) should succeed.
Another takeaway tip is to use Lambda DLQ for tracking the events which failed in the retries.
1 Comment
I just like the valuable information you supply in your articles. I will bookmark your weblog and test again here frequently. I am somewhat certain I will learn lots of new stuff right right here! Good luck for the following!