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

(se) Deferred close of SelectableChannel may result in a Selector doing the final close before concurrent I/O on channel has completed

XMLWordPrintable

    • b04
    • Verified

        The hs_err_<pid>.log shows:

        Event: 5.943 Thread 0x0000023ed289e5f0 Exception <a 'java/net/SocketException'{0x00000000dbd53808}: Socket operation on nonsocket: sendto> (0x00000000dbd53808)
        thrown [s\open\src\hotspot\share\prims\jni.cpp, line 539]

        This happens intermittently (and relatively rarely) but even if the channel is in non-blocking mode.

        Work arounds:
          - Use non-blocking IO and a RW lock to control receive/send/close and avoid concurrent calls to close
          - or make sure everything happens in the selector thread
          - or use VirtualThread for sending and receiving - but that can lead to hangs due to JDK-8334574

              jpai Jaikiran Pai
              dfuchs Daniel Fuchs
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: