RFR: 8310996: Add JFR event for connect operations [v8]
Daniel Fuchs
dfuchs at openjdk.org
Thu Dec 12 09:51:46 UTC 2024
On Tue, 10 Dec 2024 21:41:18 GMT, Tim Prinzing <tprinzing at openjdk.org> wrote:
>> Adds a JFR event for socket connect operations.
>>
>> Existing tests TestSocketEvents and TestSocketChannelEvents modified to also check for connect events.
>
> Tim Prinzing has updated the pull request incrementally with one additional commit since the last revision:
>
> requests fixes
>
> - Use IOException.toString() instead of getMessage() in case it's empty
> - Attempts to test connect exceptions may fail due to unexpected
> successful connect. Tests quit with uncompleted status if the
> connect is successful and are retried a small number of times until
> the test can be performed properly. If the retries are exceeded an
> exception is generated indicating the test can't be setup properly.
test/jdk/jdk/jfr/event/io/TestSocketAdapterEvents.java line 154:
> 152: s.connect(addr);
> 153: // unexpected, abandon the test
> 154: return false;
The main issue with using the ephemeral port range is that you might manage to connect to a server opened by another test, and that might cause the other test to fail if it's not expecting connections to get closed.
If instead you use ports in the IANA reserved port range - at least you know that you won't connect to other tests running on the same machine.
Have you tried to connect to port 225 for instance, and increase the port number up to 241 in case you still manage to connect?
Ports 225-241 are reserved by IANA - so there should be nobody listening there. I had some trouble on windows 2016 with port 47, but hopefully ports 225-241 will not have the same issue.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21528#discussion_r1881736555
More information about the hotspot-jfr-dev
mailing list