JDK-8203059 : (so) Closing a socket channel registered with Selector and with SO_LINGER set to 0 does not reset connection
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 11
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2018-05-14
  • Updated: 2018-06-27
  • Resolved: 2018-05-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b14Fixed
Related Reports
Relates :  
Description
This issue concerns closing a SocketChannel that has the SO_LINGER socket option enabled and the channel is registered with a Selector.

SO_LINGER is only specified for sockets configured in blocking mode but there are cases where libraries (or tests) may be enabling SO_LINGER on non-blocking sockets to a value of zero so that they can generate a RST to reset the connection. The behavior for the case that the channel is registered with a Selector has changed in JDK 11 (as part of JDK-8198562). In JDK 11, the peer will read EOF whereas in JDK 10 and older, the connection will be reset.

More discussion on this issue in this thread:
http://mail.openjdk.java.net/pipermail/nio-dev/2018-May/005101.html