-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Add timeout config option when invoking lambda directly. #814
Comments
Sounds pretty reasonable to me! The only problem I guess is that you can only really have one timeout configuration, so if you set it above ~30 it will lead to API Gateway handling the timeout instead of Up. I think the response was always plain-text or maybe it was JSON I forget, but there's not much control over that response |
That is an unfortunate drawback. Could the timeout be altered through the payload? If we can't do it directly, maybe some kind of reserved header.
When invoking directly we won't get the API Gateway timeout while the application will still keep control over normal timeout responses. |
Hmm yeah you're right, a header field should work fine, I'll check that out this week |
Hi @tj. This works really well in 1.6.2, thank you so much! I still have one small nuisance, the lambda timeout gets changed each time I deploy so I need to do Could we go back to having 2 timeouts, one for lambda, one for proxy? From my understanding the proxy will timeout before API Gateway so the user experience will be the same, and if we choose to increase the lambda timeout for background work the lambda timeout is on us. |
Hmm if you set the |
I see... I can set timeout to 25 seconds on "normal" requests through the header and leave proxy.timeout 900. That would work, but there is still a validation of maximum 25 seconds on the
|
Oh sorry what I said doesn't make sense actually, not sure what I was thinking haha. The regular proxy.timeout should be ok for the 25 seconds for API Gateway, and then this X-Up-Timeout for internal invocations? I thought that was the intention of d5e15df |
Yes, that is the way I wanted to use it, but |
You're right sorry, my brain wasn't working yesterday haha. I'll add an option and maybe just default it to something higher |
|
Just tested it and it works perfectly. Thanks! |
awesome! |
Hi @Dankimhaejun, the fields you are looking for is
|
Yeah unfortunately HTTP requests from API Gateway can't be more than 30s at the moment, this other timeout only works if you invoke Lambda directly |
Hi there, Sorry to dig this up, and i know that #814 is still not documented, but I could need some help with the "undocumented documentation" ;) When setting the up.json up version: 1.7.0 Ex: up.json
(To make things a bit more fuzzy, that timeout always comes long before the Adding the Ex: lambda invoke that always run until the
The question : Do we need to set up the If "yes" : Which lambda timeout setting will prevail ? (assuming you feel like setting 2 distinct values ...) BTW : Apex Up is a real joy to work with, just like the many other things you have done so far; Thx for all of that great job @tj ! |
@XavM good question :D, you would still have to set both in the direct-invocation scenario. The It's a bit awkward, but Up wasn't really designed to be a FaaS replacement, so I wouldn't rely on this too much personally. |
Crystal clear, and thank you for the quick reply !! |
Prerequisites
up upgrade
)-v, --verbose
flag.Description
I'd like to call my application (lambda function) directly with cloudwatch for daily batch work which takes longer than 30 seconds. I've increase the timeout on my lambda function, but there is still a timeout in up which I can't modify. I did find a similar request #751. I'm asking for the something similar with another reason. Please give us a way to increase the timeout when calling lambda directly and not through api gateway.
I understand as a workaround I can deploy "background work" as a separated function and call it, but up is already configured with all my CI pipelines and environment variables and I really like using up! This would be an amazing feature for me.
Steps to Reproduce
Deploy an application which takes longer than 15 seconds to complete:
Run the following commands:
Output:
When I try to increase the timeout to 100 using
.proxy.timeout
:up.json for reference:
Love Up?
Please consider signing up for Up Pro (https://up.docs.apex.sh/#guides.subscribing_to_up_pro) or donating via https://opencollective.com/apex-up/donate.
Slack
Join us on Slack https://chat.apex.sh/
EDIT: updated aws cli command to work with cli version 2
The text was updated successfully, but these errors were encountered: