8203937: Not possible to read data from socket after write detects connection reset
Alan Bateman
Alan.Bateman at oracle.com
Sun Jun 3 11:07:36 UTC 2018
This is a follow-up to the "Problem with half-closure related to
connection-reset in Java 11" thread that we've been discussing here over
the last few days. As we discussed, you can't reliably rely on being
able to read bytes after the connection reset but it is a reminder that
a subtle behavior change (even in a completely unspecified area) can
break existing tests or code that may rely on the behavior on specific
platforms.
The following is the webrev to remove the detection of connection reset
in the socket writing good. We can think of this as a follow-up to
JDK-8199329 in that it removes more of the JDK 1.4 era code that special
cased connection reset on Solaris to work around the eager reporting of
network errors. With this change, it means that hitting the connection
reset when writing will not interfere with any subsequent reading from
the socket. I've added a test to ensure that further changes in this
area don't change the behavior on Linux and macOS. I've run the tests
several hundred tests and haven't seen any intermittent failures (which
is always a concern with tests like this).
http://cr.openjdk.java.net/~alanb/8203937/webrev/index.html
-Alan
More information about the net-dev
mailing list