-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using invoke to call another lambda function always timeout. #885
Comments
I would advise against calling a lambda function from within a lambda function synchronously like that. It results in you effectively being double-billed. In this case it looks like that other lambda function is taking so long that it's causing the initial function to time out. You will need to either increase your timeout, invoke the other lambda asynchronously, or optimize the other lambda function. |
@JordonPhillips hmm, I'm only triggering the other lambda function if a certain condition is met, I'm not sure if that means double billed. On the other hand, we are trying to print on the second function, I'm not sure what can I still optimized there. Indeed, I should call the other function asynchronously. However, this seems to be some user permission issue that I can't debug, I tried to do it in my personal root account and everything seems perfectly fine. Thanks for responding though. Closing this now. |
I am having similar issue, I am unable to invoke lambda function asynchronously. Is there something I am missing. |
@jgardezi as it turns out, my problem was I was running it on a public subnet, and lambda doesn't have an elastic ip to use internet gateway. So switching to private subnet with a nat solves my problem. I hope that helps you or have more clue about your problem. |
I am running Lambda as Kinesis consumer and invoking function in itself.
|
By the way, API Gateway's main lambda will only run for 20s, that's why delegating synchronously to other lambdas is a bad idea |
This is untrue. Although the maximum timeout on the API Gateway is 29 seconds, the invoked lambda can run up to 300 seconds if its timeout is set to maximum. The invocation with return a timeout to the API caller, but the lambda will keep running. |
Hello,
Apologies if this is not the right place to file this issues. But please let me try to explain my situation.
I have an API Gateway that can successfully call a lambda function. This lambda function base on a certain condition should invoke another lambda function. The code is very simple:
However I can't seem to reach other function, the other function is just printing the payload for now. I cannot even get the
res
variable. Here are the logs:This is running under a VPC and I set the security group to accept all inbound and outbound connection. I use
arn:aws:iam::aws:policy/AWSLambdaFullAccess
manage role for both of them.Am I missing something here?
The text was updated successfully, but these errors were encountered: