Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-10165

DatagramSocket can throw SocketException instead of IOException when operation not permitted on JDK17

    XMLWordPrintableJSON

Details

    Description

      On JDK 17, a DatagramSocket can throw `SocketException` for "Operation not permitted". In the same situation where on JDK11 it would throw `IOException`.
       
      `Transport.doSend()` logs a `SocketException` as an error. It delegates handling the `IOException` to its messenger, which logs it as a warning.

      So the exception is logged as an error on JDK17, where on JDK11 it would be logged as a warning.
       
      Example failure in CI:

      Example stack trace on JDK17:

      [vm5] [error 2022/03/23 20:00:06.635 UTC  <Shutdown Message Thread for heavy-lifter-1c2c92cd-65e8-5d6a-a2fd-52d05cdafe97(45303)<v2>:47672> tid=0x40d] Exception caught while sending message
      [vm5] java.net.SocketException: Operation not permitted
      [vm5] at java.base/sun.nio.ch.DatagramChannelImpl.send0(Native Method)
      [vm5] at java.base/sun.nio.ch.DatagramChannelImpl.sendFromNativeBuffer(DatagramChannelImpl.java:901)
      [vm5] at java.base/sun.nio.ch.DatagramChannelImpl.send(DatagramChannelImpl.java:863)
      [vm5] at java.base/sun.nio.ch.DatagramChannelImpl.send(DatagramChannelImpl.java:821)
      [vm5] at java.base/sun.nio.ch.DatagramChannelImpl.blockingSend(DatagramChannelImpl.java:853)
      [vm5] at java.base/sun.nio.ch.DatagramSocketAdaptor.send(DatagramSocketAdaptor.java:218)
      [vm5] at java.base/java.net.DatagramSocket.send(DatagramSocket.java:664)
      [vm5] at org.jgroups.protocols.UDP._send(UDP.java:224)
      [vm5] at org.jgroups.protocols.UDP.sendUnicast(UDP.java:215)
      [vm5] at org.jgroups.protocols.TP.sendToSingleMember(TP.java:1985)
      [vm5] at org.jgroups.protocols.TP.doSend(TP.java:1962)
      [vm5] at org.apache.geode.distributed.internal.membership.gms.messenger.Transport.doSend(Transport.java:85)
      [vm5] at org.jgroups.protocols.TP.send(TP.java:1948)
      [vm5] at org.apache.geode.distributed.internal.membership.gms.messenger.Transport._send(Transport.java:57)
      [vm5] at org.jgroups.protocols.TP.down(TP.java:1515)
      [vm5] at org.jgroups.stack.Protocol.down(Protocol.java:439)
      [vm5] at org.apache.geode.distributed.internal.membership.gms.messenger.StatRecorder.down(StatRecorder.java:87)
      [vm5] at org.jgroups.protocols.UNICAST3.down(UNICAST3.java:646)
      [vm5] at org.jgroups.protocols.FlowControl.down(FlowControl.java:347)
      [vm5] at org.jgroups.protocols.FRAG2.down(FRAG2.java:136)
      [vm5] at org.jgroups.stack.ProtocolStack.down(ProtocolStack.java:1039)
      [vm5] at org.jgroups.JChannel.down(JChannel.java:790)
      [vm5] at org.jgroups.JChannel.send(JChannel.java:426)
      [vm5] at org.apache.geode.distributed.internal.membership.gms.messenger.JGroupsMessenger.send(JGroupsMessenger.java:838)
      [vm5] at org.apache.geode.distributed.internal.membership.gms.messenger.JGroupsMessenger.send(JGroupsMessenger.java:681)
      [vm5] at org.apache.geode.distributed.internal.membership.gms.GMSMembership.send(GMSMembership.java:1335)
      [vm5] at org.apache.geode.distributed.internal.DistributionImpl.send(DistributionImpl.java:291)
      [vm5] at org.apache.geode.distributed.internal.ClusterDistributionManager.sendViaMembershipManager(ClusterDistributionManager.java:2067)
      [vm5] at org.apache.geode.distributed.internal.ClusterDistributionManager.sendShutdownMessage(ClusterDistributionManager.java:1965)
      [vm5] at org.apache.geode.distributed.internal.ClusterDistributionManager.lambda$shutdown$2(ClusterDistributionManager.java:1134)
      [vm5] at java.base/java.lang.Thread.run(Thread.java:833)
      

       
      Example stack trace on JDK11:

      [vm7] [warn 2022/03/24 23:40:50.949 UTC  <Shutdown Message Thread for dale-dunit(51430)<v4>:52674> tid=0x2d5] Unable to send message to dale-dunit(50205)<v3>:52673
      [vm7] java.io.IOException: Operation not permitted
      [vm7] at java.base/java.net.PlainDatagramSocketImpl.send(Native Method)
      [vm7] at java.base/java.net.DatagramSocket.send(DatagramSocket.java:695)
      [vm7] at org.jgroups.protocols.UDP._send(UDP.java:224)
      [vm7] at org.jgroups.protocols.UDP.sendUnicast(UDP.java:215)
      [vm7] at org.jgroups.protocols.TP.sendToSingleMember(TP.java:1985)
      [vm7] at org.jgroups.protocols.TP.doSend(TP.java:1962)
      [vm7] at org.apache.geode.distributed.internal.membership.gms.messenger.Transport.doSend(Transport.java:85)
      [vm7] at org.jgroups.protocols.TP.send(TP.java:1948)
      [vm7] at org.apache.geode.distributed.internal.membership.gms.messenger.Transport._send(Transport.java:57)
      [vm7] at org.jgroups.protocols.TP.down(TP.java:1515)
      [vm7] at org.jgroups.stack.Protocol.down(Protocol.java:439)
      [vm7] at org.apache.geode.distributed.internal.membership.gms.messenger.StatRecorder.down(StatRecorder.java:87)
      [vm7] at org.jgroups.protocols.UNICAST3.down(UNICAST3.java:646)
      [vm7] at org.jgroups.protocols.FlowControl.down(FlowControl.java:347)
      [vm7] at org.jgroups.protocols.FRAG2.down(FRAG2.java:136)
      [vm7] at org.jgroups.stack.ProtocolStack.down(ProtocolStack.java:1039)
      [vm7] at org.jgroups.JChannel.down(JChannel.java:790)
      [vm7] at org.jgroups.JChannel.send(JChannel.java:426)
      [vm7] at org.apache.geode.distributed.internal.membership.gms.messenger.JGroupsMessenger.send(JGroupsMessenger.java:838)
      [vm7] at org.apache.geode.distributed.internal.membership.gms.messenger.JGroupsMessenger.send(JGroupsMessenger.java:681)
      [vm7] at org.apache.geode.distributed.internal.membership.gms.GMSMembership.send(GMSMembership.java:1335)
      [vm7] at org.apache.geode.distributed.internal.DistributionImpl.send(DistributionImpl.java:291)
      [vm7] at org.apache.geode.distributed.internal.ClusterDistributionManager.sendViaMembershipManager(ClusterDistributionManager.java:2067)
      [vm7] at org.apache.geode.distributed.internal.ClusterDistributionManager.sendShutdownMessage(ClusterDistributionManager.java:1965)
      [vm7] at org.apache.geode.distributed.internal.ClusterDistributionManager.lambda$shutdown$2(ClusterDistributionManager.java:1134)
      [vm7] at java.base/java.lang.Thread.run(Thread.java:829)
      

      Attachments

        Issue Links

          Activity

            People

              dschneider Darrel Schneider
              demery Dale Emery
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: