JDK-8278961 : Enable debug logging in java/net/DatagramSocket/SendDatagramToBadAddress.java
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.net
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-12-17
  • Updated: 2023-01-13
  • Resolved: 2022-01-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 19
17.0.7-oracleFixed 19 b06Fixed
Description
The test failed intermittently as noted in https://bugs.openjdk.java.net/browse/JDK-8278858, but by default that test doesn't log anything informative. It does have a flag which can be passed to enable the debug logging which could provide hints on why it might be failing (whenever it does the next time).
Comments
Fix request [17u] I backport this for parity with 17.0.7-oracle. No risk, only a test change. Clean backport. Test passes. SAP nighlty testing passes.
13-01-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1064 Date: 2023-01-12 16:58:43 +0000
12-01-2023

Changeset: c17a0122 Author: Jaikiran Pai <jpai@openjdk.org> Date: 2022-01-13 13:23:57 +0000 URL: https://git.openjdk.java.net/jdk/commit/c17a0122c4b5f17b85dc0bee0777b2a831debf6d
13-01-2022

I have run the amended test on the failing MACH5 host and this is the output ----------messages:(4/185)---------- command: main SendDatagramToBadAddress -d reason: User specified action: run main/othervm SendDatagramToBadAddress -d Mode: othervm [/othervm specified] elapsed time (seconds): 20.084 ----------configuration:(0/0)---------- ----------System.out:(19/746)---------- 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 55933 Checking send to connected address ... socket is locally bound to address /127.0.0.1 port 57136 received data from address /127.0.0.1 port 57136 received data from address /127.0.0.1 port 57136 received data from address /127.0.0.1 port 57136 received data from address /127.0.0.1 port 57136 received data from address /127.0.0.1 port 57136 Checking send to non-connected address ... received data from address /127.0.0.1 port 57136 Checking send to invalid address ... socket timeout socket timeout socket timeout socket timeout socket timeout Didnt get expected exception: ----------System.err:(13/796)---------- java.lang.Exception: send did not return expected error at SendDatagramToBadAddress.test(SendDatagramToBadAddress.java:192) at SendDatagramToBadAddress.run(SendDatagramToBadAddress.java:111) at SendDatagramToBadAddress.main(SendDatagramToBadAddress.java:103) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:577) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127) at java.base/java.lang.Thread.run(Thread.java:833) JavaTest Message: Test threw exception: java.lang.Exception: send did not return expected error JavaTest Message: shutting down test STATUS:Failed.`main' threw exception: java.lang.Exception: send did not return expected error
13-01-2022

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 server. BUT, it is not obliged to do so -- it is not mandaotory in the spec. Nonetheless it's a good idea to turn on the diagnostics -- we have used them in private test runs.
17-12-2021

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/6883 Date: 2021-12-17 14:52:53 +0000
17-12-2021