- Newest
- Most votes
- Most comments
Hello.
If an asynchronous call is executed twice, the most likely scenario is that an error has occurred.
However, in this case, since the response is 200 and the program is running without error, it is necessary to check that the caller is not executing the program continuously.
https://docs.aws.amazon.com/lambda/latest/dg/invocation-retries.html
Asynchronous invocation – Lambda retries function errors twice. If the function doesn't have enough capacity to handle all incoming requests, events might wait in the queue for hours or days to be sent to the function. You can configure a dead-letter queue on the function to capture events that weren't successfully processed. For more information, see Asynchronous invocation.
The following document contains checkpoints for consecutive runs.
Please check once.
https://repost.aws/knowledge-center/lambda-function-duplicate-invocations
By the way, am I right in thinking that there are no errors left in CloudWathc Logs?
Jan 2024, The issue with the direct invocation of the lambda function URL still exists. There is a simple workaround although cost wise it will not save much. Just add a query parameter to the function URL: yourfunctionurl?somequery=xxxxx When the function is auto invoked second time the somequery value will be blank / null / None. Use that to return the function.
Relevant content
- asked 4 years ago
- Accepted Answerasked 7 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
Thanks for the pointers... but I have checked these and looks like there is no error. Also, I just tested it with the TEST function in the AWS Lambda area and it runs only once and results as expected. Only when I run the url (function) it runs twice ? Any pointers for that ? Thanks in advance !
Are there any clients that use function URLs that are executed twice in a row? Is there a mechanism in place to make consecutive requests on the client side?
I just wrote this function today and its not used by anything at the moment. I wanted to test it first so, I am calling the (function) URL directly from the browser. Just once and it runs twice, but when I test from the Function-Test (lambda) it runs once and as expected. Very strange !
I checked in my environment and two logs were output if the browser is Google Chrome. With Microsoft Edge, only one log was output. So the problem is likely to be in the browser.
Here is the log of my attempt. The red boxed area is the log when accessed by Chrome. In the case of Chrome, two logs were output. The blue boxes are logs accessed by Microsoft Edge. In the case of Microsoft Edge, only one log is output.
So please change your browser and try accessing the site. Perhaps the results will change.