-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Socket timeouts are checked before pending incoming requests are assigned sockets, causing ECONNRESET
s
#43456
Comments
Hm, that's not how I interpret these logs. In this capture, the highlighted row (13) is the 3rd request: And the corresponding Node.js logs:
Key points:
|
Sorry, i can not get the point. The reason why the socket 1 is closed(by client) early(5 ms) is the client have exited, when you add setInterval(() => {}, 10000) to client.js. the socket 1 will be closed by server after 1 s.
|
Client assigned req 2 server closed socket 0 Why socket 0 didnt handle req 2? It came before the socket closed on server and before timeout (1 sec after sending response). |
Version
14.19.1 and others
Platform
Linux qa01-api-1 5.13.0-1024-gcp #29~20.04.1-Ubuntu SMP Thu Apr 14 23:15:00 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
net
What steps will reproduce the bug?
Process 1:
Process 2:
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior?
All three requests should succeed.
What do you see instead?
The server logs will look like this:
and client
Notice: req[2] is assigned a socket at 51.815, just after req[1] is received by the server. Server socket[0] is closed at 53.320, just after the blocking work on req[2], even though there's a request that could be assigned to that socket. I think what's happening is that timers are checked before pending incoming messages are assigned sockets.
Additional information
ECONNRESET
s due to Keep-Alive races need to be handled by clients (see #20256, #38890 and several others), but I think this particular scenario can be fixed to avoid a subset of them.The text was updated successfully, but these errors were encountered: