Skip to content
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

Timeout was reached error with incorrect status: SUCCESS #74

Closed
tonyxiao opened this issue Oct 26, 2022 · 4 comments
Closed

Timeout was reached error with incorrect status: SUCCESS #74

tonyxiao opened this issue Oct 26, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@tonyxiao
Copy link

Bug report

  1. Run supabase/postgres docker
  2. Run sql
CREATE EXTENSION IF NOT EXISTS pg_net;
select
    net.http_post(
        url:='https://httpbin.org/post',
        body:='{"hello": "world"}'::jsonb
    );

select
  *
from
  net.http_collect_response(1);

@see

pg_net: Timeout was reached - Watch Video

Notice how the status says SUCCESS, but upon inspecting the net._http_response table, it says timeout was reached. Additionally it appears that the request was never made according to the remote server.

@tonyxiao tonyxiao added the bug Something isn't working label Oct 26, 2022
@steve-chavez
Copy link
Member

Thanks for the report. Note that there's a timeout(by default 2 seconds) you can add to the function.

select
    net.http_post(
        url:='https://httpbin.org/post',
        body:='{"hello": "world"}'::jsonb,
        timeout_milliseconds := 5000
    );

The SUCCESS is indeed a mistake.

@tonyxiao
Copy link
Author

tonyxiao commented Nov 3, 2022

I see. What's the default timeout on supabase itself? Or is it simply faster on supabase and therefore within the 2000ms timeframe?

@steve-chavez
Copy link
Member

Default it's the same - 2 seconds.

Or is it simply faster on supabase and therefore within the 2000ms timeframe?

Yeah, latency might be lower due to network proximity.

@steve-chavez
Copy link
Member

http_collect_response was made a private function on #81.

For now it's better to inspect net._http_response directly. We're going to improve this on #62.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants