Api gateway idle request timeout is set to 60s in local stack
Describe the bug Hello!
I have an edge function which calls a LLM API as dependency, and this LLM API can take a while to respond, about 60s+
I'm consistently getting a 504 Gateway timeout at the 60s mark, which I believe is from the Kong API Gateway that has a 60s timeout by default.
In the production supabase hosted functions, the idle timeout is 150s according to the docs. I've tested my API with the deployed edge function and my API call succeeds as gateway allows for the request to go beyond the 60s mark.
My thought is the timeout of the local stack kong being 60s must be an oversight, since the prod versions support more. Are we able to increase the kong timeout to 150s to match the prod version? I'm free to help if needed.
Also, I'm somewhat new to supabase so let me know if I'm misunderstanding anything.
To Reproduce Steps to reproduce the behavior:
- supabase start
- serve an edge function locally and in the code add a sleep function like setTimeout to wait for 70s
- call the function with a http client like curl or insomnia
- See the 504 error show up at the 60s mark
Expected behavior The kong api gateway should allow idle requests to go up to 150s
Screenshots
System information
Rerun the failing command with --create-ticket flag.
- Ticket ID: (Didn't get a ticket ID from the flag)
- Version of OS: Manjaro x86_64 kernel: 6.9.3-3-MANJARO
- Version of CLI: 1.176.10
- Version of Docker: 26.1.3
- Versions of services:
supabase/postgres │ 15.1.1.56
supabase/gotrue │ v2.152.0
postgrest/postgrest │ v12.1
supabase/realtime │ v2.28.32 supabase/storage-api │ v1.2.1 supabase/edge-runtime │ v1.54.2
supabase/studio │ 20240422-5cf8f30 supabase/postgres-meta │ v0.80.0
supabase/logflare │ 1.4.0
supabase/supavisor │ 1.1.56
darthsim/imgproxy │ v3.8.0
Following, have same problem
I've increased the timeout to 150s in cli beta release.
npx supabase@beta start
I've increased the timeout to 150s in cli beta release.
npx supabase@beta start
@sweatybridge I believe the same problem also exists for memory limit. When I locally run a function that contains a sizable image my function being terminated for exceeding memory. However when the edge function is deployed there isn't any memory issue so the underlying cause is probably the same. Is there an existing issue for this bug as well?
I believe the same problem also exists for memory limit.
You are right. I will address this in another release https://github.com/supabase/cli/issues/2500
Thank you for spotting these inconsistencies.