RFR: 8310978: JFR events SocketReadEvent/SocketWriteEvent for Socket adaptor ops [v3]
Alan Bateman
alanb at openjdk.org
Thu Oct 26 10:50:35 UTC 2023
On Wed, 25 Oct 2023 21:43:54 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:
>
> changes from review:
>
> - use loopback address
> - fetch timeout once
> - formatting improvements
test/jdk/jdk/jfr/event/io/TestSocketAdapterEvents.java line 48:
> 46:
> 47: /**
> 48: * @test
It might be useful to have the `@bug` tag to link to JDK-8310978.
test/jdk/jdk/jfr/event/io/TestSocketAdapterEvents.java line 91:
> 89:
> 90: int bytesRead = is.read(bs, 0, 3);
> 91: assertEquals(bytesRead, 3, "Wrong bytesRead partial buffer");
This is probably okay although in theory the read method may return 1 or 2 bytes here. Initially I thought you should be using readNBytes here but that may involve more than one read and thus disrupt the number of events expected.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16251#discussion_r1372962518
PR Review Comment: https://git.openjdk.org/jdk/pull/16251#discussion_r1372961460
More information about the nio-dev
mailing list