RFR: 8319757: java/nio/channels/DatagramChannel/InterruptibleOrNot.java failed: wrong exception thrown [v2]

Alan Bateman alanb at openjdk.org
Sat Jan 6 08:55:30 UTC 2024


On Fri, 5 Jan 2024 16:06:55 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Given that these are unconnected DatagramChannels, do you think this test is susceptible to receiving unexpected packets (in CI environments) and can run into intermittent failures (receive completing successfully before being interrupted)? Would making them connected (to a test specific address that never sends anything) improve the situation or would that then take a different code path than what this test intends to test?

I view the issue interference (stray datagrams) from other tests/programs as a separate topic. It would be useful to audit the DatagramChannel, DatagramSocket, and other tests that send unicast datagrams to identity the tests that send to target addresses/ports that the test doesn't control. Tests for PortUnreachableException or tests that need to use specific protocol families (IPv4 or IPv6) are examples. It sometimes feels like these need to be isolated, I don't think jtreg exclusivedirs provides enough as it's a lock file for a specific tree rather than all agent VMs. In addition, it would be a bit unusual to use send/receive on a connected DatagramChannel. It's allowed of course but usually it's read/write when connected. So I agree your suggestion is something we should consider doing, I view is as part of broader issue to reduce and eliminate interference from other programs or tests. This PR is more focused on fixing the timing issue in the test where a channel can be closed a
 nd the thread blocked on the channel interrupted at around the same time.

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

PR Comment: https://git.openjdk.org/jdk/pull/17251#issuecomment-1879597678


More information about the nio-dev mailing list