2 ms·
This is only really a problem when there's a collision of the quadruple identifying the connection. The article indicates as much - "If you want to reproduce t
by wyldfire 10y ago
This is only really a problem when there's a collision of the quadruple identifying the connection. The article indicates as much - "If you want to reproduce this weird scenario consider running this script. It will greatly increase the probability of netcat hitting the conflicted socket".
I will admit that I probably wouldn't expect an ETIMEDOUT over a loopback, but I think I would very quickly assume that one side or the other has a bug regarding leaked resources.
> It seems that the design decisions made by the BSD Socket API have unexpected long lasting consequences. If you think about it - why exactly the socket can automatically expire the FIN_WAIT state, but can't move off from CLOSE_WAIT after some grace time. This is very confusing... And it should be!
One side-effect of having a timeout drive you from CLOSE_WAIT to LAST_ACK without a close() would be that the remote side would not be able to see the application-level reaction to its active close. Determining whether this was a graceful application-level closure would not be possible anymore (though I'll admit I'm not sure how critical that is to the protocol).
- majke 10y agoCorrect. To be hit by this problem you need leaking sockets AND a client that opens and closes sockets rapidly. What I didn't write is that we had a "bind before connect" on the client side, which means you could hit the CLOSE_WAIT _faster_ than after going through 30k+ sockets. Bind-before-connect sockets have random src port number, therefore depending on setup we hit the colliding socket in a thousand or so sockets, not in 30k+ sockets. Interesting comment on potential implications of automatically transitioning from CLOSE_WAIT.