Problem with half-closure related to connection-reset in Java 11

Florian Weimer fweimer at redhat.com
Fri Jun 1 12:19:33 UTC 2018


On 06/01/2018 02:13 PM, Alan Bateman wrote:
> I can't say for sure whether the kernels actually drop the socket buffer 
> or not. For the scenario, the connection reset is reported when writing 
> and on both Linux and macOS you can read the previously received bytes 
> in the socket buffer.

But there is a race, even on Linux.  If the network is fast enough and 
you get an RST segment from the other end, kernel the receive buffer is 
discarded.

So whatever you do on the JDK side, it's probably papering over an 
application bug that does not show up on some networks by sheer luck.

Thanks,
Florian


More information about the net-dev mailing list