Skip to content

httpx.ReadTimeout: timed out Supabase functions #814

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

Closed
RedChops opened this issue Jun 3, 2024 · 3 comments · Fixed by #846
Closed

httpx.ReadTimeout: timed out Supabase functions #814

RedChops opened this issue Jun 3, 2024 · 3 comments · Fixed by #846
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@RedChops
Copy link

RedChops commented Jun 3, 2024

Feature request

Is your feature request related to a problem? Please describe.

When calling an Edge Function using client.functions.invoke(), if the function takes longer than 5 seconds to run I'll get a ReadTimeout exception

Describe the solution you'd like

I would like a way to configure the HTTPX timeout for Edge Function calls, the same way we can currently configure PostgREST and Storage. Or a way to supply a custom HTTPX client to supafunc-py

Describe alternatives you've considered

The following will let me create a client with a longer timeout, but it's accessing private interfaces:

supabase: Client = create_client(url, key, options=client_options)
func_headers = supabase.functions.headers
func_url = supabase.functions.url
timeout_client = utils.SyncClient(timeout=300.0, base_url=func_url, headers=func_headers, follow_redirects=True)
supabase.functions._client = timeout_client
@RedChops RedChops added the enhancement New feature or request label Jun 3, 2024
@silentworks
Copy link
Contributor

Have you tested the alternative you described and its working? I'm asking because looking at the edge functions limits the CPU time is 2 seconds which is less than the default 5 seconds. https://supabase.com/docs/guides/functions/limits#runtime-limits

@silentworks silentworks self-assigned this Jun 25, 2024
@RedChops
Copy link
Author

@silentworks I have, I've implemented this alternative in several scripts at this point. The CPU timeout is 2 seconds, yeah, but the total request timeout (according to the next line) is 150 seconds.

A lot of our edge functions themselves make network requests (main reason why we use them over plpgsql stored procedures really), so can take upwards of 30 seconds sometimes, depending.

@silentworks silentworks moved this to Todo in Supabase Python Jun 25, 2024
@silentworks silentworks added this to the Stable milestone Jun 25, 2024
@silentworks
Copy link
Contributor

@RedChops thanks for getting back to me on this. I have added it to the Todo list and will try and get it added.

juancarlospaco added a commit to juancarlospaco/supabase-py that referenced this issue Jul 3, 2024
juancarlospaco added a commit to juancarlospaco/supabase-py that referenced this issue Jul 3, 2024
@juancarlospaco juancarlospaco mentioned this issue Jul 3, 2024
juancarlospaco added a commit to juancarlospaco/supabase-py that referenced this issue Jul 3, 2024
juancarlospaco added a commit to juancarlospaco/supabase-py that referenced this issue Jul 3, 2024
silentworks pushed a commit to juancarlospaco/supabase-py that referenced this issue Jul 24, 2024
silentworks pushed a commit to juancarlospaco/supabase-py that referenced this issue Jul 24, 2024
silentworks pushed a commit to juancarlospaco/supabase-py that referenced this issue Jul 24, 2024
silentworks pushed a commit to juancarlospaco/supabase-py that referenced this issue Jul 24, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Supabase Python Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants