RFR: 8310996: Add JFR event for connect operations

Alan Bateman alanb at openjdk.org
Wed Oct 16 06:49:16 UTC 2024


On Wed, 16 Oct 2024 01:19:15 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.

src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java line 1006:

> 1004:         boolean connected = implConnect(sa);
> 1005:         SocketConnectEvent.offer(start, connected, sa);
> 1006:         return connected;

It would be useful if the JBS or PR could say what the intent it for SocketChannels that are configured non-blocking. I assume that implConnect will execute in <20ms (the threshold in the JFR config) so no event will be ever be recorded when configured non-blocking. It would be possible to save the timestamp when connecting, and then use in finishConnect but that does depend on timely usage.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21528#discussion_r1802458279


More information about the nio-dev mailing list