JDK-8278858 : java/net/DatagramSocket/SendDatagramToBadAddress.java failed with "Exception: send did not return expected error"
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 17.0.3,18,19
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • CPU: x86_64,aarch64
  • Submitted: 2021-12-15
  • Updated: 2022-05-16
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.
Other
tbdUnresolved
Related Reports
Relates :  
Sub Tasks
JDK-8278961 :  
Description
The following test failed in the JDK18 CI:

java/net/DatagramSocket/SendDatagramToBadAddress.java

Here's a snippet from the log file:

#section:main
----------messages:(4/179)----------
command: main SendDatagramToBadAddress
reason: User specified action: run main/othervm SendDatagramToBadAddress 
Mode: othervm [/othervm specified]
elapsed time (seconds): 20.069
----------configuration:(0/0)----------
----------System.out:(0/0)----------
----------System.err:(13/796)----------
java.lang.Exception: send did not return expected error
	at SendDatagramToBadAddress.test(SendDatagramToBadAddress.java:183)
	at SendDatagramToBadAddress.run(SendDatagramToBadAddress.java:108)
	at SendDatagramToBadAddress.main(SendDatagramToBadAddress.java:100)
	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
----------rerun:(36/5975)*----------
Comments
The difference in build version is interesting, it looks like there may be different beta releases of 12.1 on some of these systems.
26-01-2022

A note on the SendDatagramSocket -- there is a possible flaw in the test, which could lead to other intermittent issues in a heavily loaded environment. The test creates a "server" DatagramSocket and then closes the socket prior to send/recv scenario to trigger PortUnreachableException. The assumption is that the release port won't be re-used by the kernel during the lifetime of the test -- the port resource re-use being subject to port randomisation allocation and a ttl before re-allocation .... but on heavily loaded system a typical test execution duration might be extended to a couple of minutes, increasing a possibility of a port clash This has not been observed as contributing to this issue.
15-01-2022

I suspect JDK-8278229 is related to this too - the test there expects PortUnreachable and fails in timeout - and apparently on the same host. There might be something going on that machine.
17-12-2021