RFR: 8310807: java/nio/channels/DatagramChannel/Connect.java timed out [v2]
Jaikiran Pai
jpai at openjdk.org
Thu Nov 16 13:27:37 UTC 2023
On Tue, 14 Nov 2023 18:01:44 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Please find here a fix for a timeout issue observed in DatagramChannel/Connect.java
>>
>> The suspicion is that the responder may have received some message from some other source and replied to that, leaving the initiator waiting forever.
>>
>> The proposed fix makes sure the messages exchanged are unique and identifiable and ensure that both the initiator and responder will discard any message that do not have the expected content.
>>
>> Additional logging should help with diagnosis if the test fails again.
>
> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>
> Minor cleanup 3
test/jdk/java/nio/channels/DatagramChannel/Connect.java line 116:
> 114: int port = dc.socket().getLocalPort();
> 115: InetAddress loopback = InetAddress.getLoopbackAddress();
> 116: InetSocketAddress otherAddress = new InetSocketAddress(loopback, (port == 3333 ? 3332 : 3333));
Hello Daniel,
It was a bit surprising to see a specific port value being used here (before the changes in the PR). So I looked at the history of this test to see if it was intentional and was there for some specific reason. It appears that this was an unintentional leftover from one of the previous refactoring of this test. Using an ephemeral port for this `otherAddress`, like you now do in this PR, looks good to me then.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16661#discussion_r1395690955
More information about the nio-dev
mailing list