(ch) DatagramChannel.receive should throw ClosedChannelException when called on closed channel

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 23
    • Affects Version/s: 11, 23
    • Component/s: core-libs
    • b19
    • Verified

      https://bugs.openjdk.org/browse/JDK-8327650 addresses a jtreg timeout failure in java/nio/channels/DatagramChannel/StressNativeSignal.java due to a race condition. This failure highlighted an anomaly in the specific Exceptions thrown due to an asynchronous close and further investigation uncovered additional issues with a ClosedByInterruptedException.

      In StressNativeSignal test, a race condition caused the repeated executed of a receive loop. The initial iteration should have resulted in an AsynchronousCloseException and a subsequent invocation of received resulting in a ClosedChannelException.

       the ClosedChannelException is thrown by the receive call flow but due inheritance from AbstractInterruptibleChannel, it is "overtaken" by the AsynchronousCloseException thrown by the AIC::end method

        1. CCE.patch
          5 kB
          Alan Bateman
        2. ClosedNetworkChannels.java
          7 kB
          Alan Bateman

            Assignee:
            Mark Sheppard
            Reporter:
            Mark Sheppard
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: