On Wed, 16 Oct 2024 06:46:54 GMT, Alan Bateman <al...@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. The non-blocking case is poorly handled. I'll update the JBS. The untimely use of finishConnect would cause an artificially bad looking event duration which might be a bit misleading. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21528#discussion_r1807984988