Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8203059

(so) Closing a socket channel registered with Selector and with SO_LINGER set to 0 does not reset connection

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11
    • Fix Version/s: 11
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b14
    • Verification:
      Verified

      Backports

        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

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  alanb Alan Bateman
                  Reporter:
                  alanb Alan Bateman
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: