RFR: 8310978: JFR events SocketReadEvent/SocketWriteEvent for Socket adaptor ops [v2]
Alan Bateman
alanb at openjdk.org
Tue Oct 24 06:53:36 UTC 2023
On Mon, 23 Oct 2023 22:35:55 GMT, Tim Prinzing <tprinzing at openjdk.org> wrote:
>> Added jar event support to socket adapters.
>>
>> Added the test jdk/jfr/event/io/TestSocketAdapterEvents.java
>
> Tim Prinzing has updated the pull request incrementally with one additional commit since the last revision:
>
> requested change to location of socket adaptor event logic
>
> bring back event offer semantics where it was fine.
src/java.base/share/classes/sun/nio/ch/SocketInputStream.java line 82:
> 80: long start = SocketReadEvent.timestamp();
> 81: int n = implRead(b, off, len);
> 82: SocketReadEvent.offer(start, n, sc.remoteAddress(), timeoutSupplier.getAsInt());
One of the things left over from the original refactoring was to dig into my the event needs the timeout, it would be nice if that could go away.
For now, I'd prefer if the timeout could be captured once as otherwise there is no guarantee that the event will be reported with the same timeout used for the socket read. In other words, add a timeout parameter to implRead so that the method calls implRead with the timeout, avoids calling timeoutSuppler::getAsInt twice.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16251#discussion_r1369695891
More information about the nio-dev
mailing list