-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Open
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.
Description
Version
v18.14.0
Platform
Linux prometheus 6.1.9-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Feb 2 00:21:48 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
http
What steps will reproduce the bug?
Create an HTTP server with a big requestTimeout
(a day in this example):
require('node:http').createServer({
requestTimeout: 24 * 60 * 60 * 1e3, // a day
}, (req, res) => {
console.log(req.method, req.url);
req.resume().on('end', () => {
res.end('Ok');
}).on('error', console.warn);
}
).listen(8080);
Do a long running request to it:
$ curl -T /dev/urandom http://localhost:8080 -v
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /urandom HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.85.0
> Accept: */*
> Transfer-Encoding: chunked
> Expect: 100-continue
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 100 Continue
* Mark bundle as not supporting multiuse
< HTTP/1.1 408 Request Timeout
< Connection: close
<
* Send failure: Connection reset by peer
* Closing connection 0
curl: (55) Send failure: Connection reset by peer
How often does it reproduce? Is there a required condition?
It happens everytime, and I haven't been able to pinpoint the exact value at which it becomes problematic.
What is the expected behavior?
It should interrupt the request after 24 hours.
What do you see instead?
It interrupt the request after ~30 seconds.
Additional information
I can work-around by disabling the timeout (requestTimeout: 0
) completely but setting a value, even high, seemed preferable.
Any other suggestions on how to handle long running uploads?
StephenKelly94
Metadata
Metadata
Assignees
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.