[ 
https://issues.apache.org/jira/browse/GEODE-10165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Darrel Schneider resolved GEODE-10165.
--------------------------------------
    Fix Version/s: 1.15.0
       Resolution: Fixed

> DatagramSocket can throw SocketException instead of IOException when 
> operation not permitted on JDK17
> -----------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-10165
>                 URL: https://issues.apache.org/jira/browse/GEODE-10165
>             Project: Geode
>          Issue Type: Improvement
>          Components: membership
>    Affects Versions: 1.15.0
>            Reporter: Dale Emery
>            Assignee: Darrel Schneider
>            Priority: Major
>              Labels: Java17, pull-request-available
>             Fix For: 1.15.0
>
>
> 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:
> - Failure in CI (PR precheckin): 
> https://concourse.apachegeode-ci.info/builds/39064786
> - Test results: 
> http://files.apachegeode-ci.info/builds/apache-develop-pr/geode-pr-7475/test-results/distributedTest/1648074003/
> - Test run artifacts: 
> http://files.apachegeode-ci.info/builds/apache-develop-pr/geode-pr-7475/test-artifacts/1648074003/distributedtestfiles-geode-pr-7475.tgz
> Example stack trace on JDK17:
> {noformat}
> [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)
> {noformat}
>  
> Example stack trace on JDK11:
> {noformat}
> [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)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to