Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Regression in idle socket handling #24980
I'd like to report a possible regression introduced to the
Sockets that are opened but data is not transferred are closed immediately after data transmission once they have idled for >40 seconds.
Reproduction available here: https://github.com/timcosta/node_tcp_regression_test
We ran a tcpdump on our servers that were 504ing, and saw that node is responding with an
Timeouts are set to 60 seconds on the client (AWS ELB) and 2 minutes on the node server (hapi.js).
I'm filing this as a node core issue as the error can be reproduced by using both hapi and the bare node http module as can be seen in this travis build: https://travis-ci.com/timcosta/node_tcp_regression_test/builds/94440224
The error seems to be not consistent per travis on versions 8.14.0, 10.14.2, and 11.4.0 but the build consistently passes on v8.9.4 which leads me to believe there is a possible regression.
Currently we are starting to wait for the headers when we receive a connection, however we could do this on first byte solving the issue at hand. I'll see if I can code something up that will address this.
Note that this is configurable https://nodejs.org/api/http.html#http_server_headerstimeout, so you can increase that to 60s, solving your immediate issue.
We picked 40 seconds, because it is the default Apache is using.