-
-
Notifications
You must be signed in to change notification settings - Fork 21
Timeout for large payload #174
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
Comments
Any help ? Have you been able to reproduce the bug ? |
Sorry, still haven't reproduced. Our test suite is in python, @dthib If you'd like to speed up things and help, perhaps you could contribute a test? Also see https://github.com/supabase/pg_net/blob/master/docs/contributing.md#development. |
I can reproduce locally ✅ . Using this branch https://github.com/steve-chavez/pg_net/tree/174 and $ nix-shell
$ net-with-nginx net-with-pg-17 psql \set bigjson `cat test/data/big_payload.json`
select net.http_post(
url:='http://localhost:8080/post',
body:= :'bigjson'
);
http_post
-----------
1
(1 row)
# 127.0.0.1 - - [06/Mar/2025:18:31:03 -0500] "POST /post HTTP/1.1" 400 0 "-" "pg_net/0.14.0"
select * from net._http_response;
-[ RECORD 1 ]+----------------------------------------------------------------------------------------------------------------------------------------------------------------
id | 1
status_code |
content_type |
headers |
content |
timed_out |
error_msg | Timeout of 5000 ms reached. Total time: 5000.687000 ms (DNS time: 0.077000 ms, TCP/SSL handshake time: 0.398000 ms, HTTP Request/Response time: 4999.976000 ms)
created | 2025-03-06 18:30:58.929522-05 As seen above the request times out. The json file is of size:
The smaller json does work:
\set smallerjson `cat test/data/smaller_payload.json`
select net.http_post(
url:='http://localhost:8080/post',
body:= :'smallerjson'
);
http_post
-----------
1
(1 row)
# 127.0.0.1 - - [06/Mar/2025:18:38:29 -0500] "POST /post HTTP/1.1" 200 11 "-" "pg_net/0.14.0"
# select * from net._http_response;
-[ RECORD 1 ]+--------------------------------------------------------------------------------------------------------------------------------------------------------------------
id | 1
status_code | 200
content_type | application/json
headers | {"Date": "Thu, 06 Mar 2025 23:38:29 GMT", "Server": "nginx/1.26.0", "Connection": "keep-alive", "Content-Type": "application/json", "Transfer-Encoding": "chunked"}
content | +
|
timed_out | f
error_msg |
created | 2025-03-06 18:38:29.129701-05 Although for some reason the |
So when doing Lines 201 to 208 in 6051d8a
This There's a To avoid the copy, I think we're going to have to store the input as Additionally, converting the |
Bug report
Describe the bug
When the payload is large, it does not reach the endpoint and seems stuck in pg_net until a timeout is reached. This is the case with the latest pg_net version (0.14.0) installed by default but is not the case on one production system using 0.7.x pg_net version.
To Reproduce
With latest supabase version.
I have searched for a while but now we are sure that it's not related to our api because we were able to reproduce it with https://webhook.site.
select * from net.http_post(
'https://webhook.site/11a266de-f1b6-48d9-9477-3aeb8c8098cc',
'$PAYLOAD'::jsonb)
by replacing $PAYLOAD with the joined json payload.
testpayload.txt
Smaller payload testpayload_works.txt
Expected behavior
Request beeing sent to the server
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
I wanted to try other pg_net versions but I can't drop & reinstall the extension as the owner is supabase_admin.
The text was updated successfully, but these errors were encountered: