RFR: 8278961: Enable debug logging in java/net/DatagramSocket/SendDatagramToBadAddress.java

Mark Sheppard msheppar at openjdk.java.net
Fri Dec 17 18:07:24 UTC 2021


On Fri, 17 Dec 2021 14:52:53 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review for this test only change which proposes to enable debug logs from the test that failed intermittently? This change addresses https://bugs.openjdk.java.net/browse/JDK-8278961.
> 
> The change passes the (test specific) `-d` option to enable logs from that test by default. While I was at it, I even added a few more debug logs hoping it might provide some hints if/when it fails next.
> 
> For reference, a (successful) run of this test will now print something like:
> 
> 
> ----------System.out:(18/930)----------
> running on OS that supports ICMP port unreachable
> Testing with class java.net.DatagramSocket
> tests will be run against destination address localhost/127.0.0.1 port 52682
> Checking send to connected address ...
> socket is locally bound to address /127.0.0.1 port 52681
> received data from address /127.0.0.1 port 52681
> received data from address /127.0.0.1 port 52681
> received data from address /127.0.0.1 port 52681
> received data from address /127.0.0.1 port 52681
> received data from address /127.0.0.1 port 52681
> Checking send to non-connected address ...
> received data from address /127.0.0.1 port 52681
> Checking send to invalid address ...
> Got expected exception: java.net.PortUnreachableException
> Got expected exception: java.net.PortUnreachableException
> Got expected exception: java.net.PortUnreachableException
> Got expected exception: java.net.PortUnreachableException
> Got expected exception: java.net.PortUnreachableException

it is a good idea to turn on the diagnostics -- we have used it in private test runs.

the current crop of failures are on macos-aarch64, it appears to be an OS issue, in that an ICMP destination unreachabale is not being generated for the UDP sends to an non existent socket end point. BUT, there is no obligation to do so -- it is not mandaotory in the spec, something along the lines:

"If, in the destination host, the IP module cannot deliver the datagram because the indicated protocol module or process port is not active, the destination host **may** send a destination unreachable message to the source host." 

The question is: "is it a bug or feature in the OS?" Or it could be a host confoguration issue. There may be some configuration that has disabled ICMP, maybe a firewall policy or security setting in the kerenal, not to generate ICMP DST Unreachable responses?
We haven't found one yet.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6883


More information about the net-dev mailing list