On Thu, 12 Nov 2026 04:24:54 GMT, Erik Gahlin <[email protected]> wrote:

> Could I have a review of a PR that fixes missing socket events when an 
> exception occurs? These events were lost when we changed from bytecode 
> instrumentation to static event commits.
> 
> I didn't add testing for timeouts because I worry the tests will be flaky or 
> slow. 
> 
> Testing: jdk_net, jdk_nio_networkchannel, test/jdk/jdk/jfr
> 
> 
> 
> Thanks
> Erik
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Changes LGTM. I'm not able to spot any changes from [JDK-8308995] where the 
failure branch is missing to emit a JFR event.

> The fix looks good, but why no regression test? Can't it be a deterministic 
> test that does not rely on timeouts? E.g., if it just reads/writes to a 
> closed socket.

Agreed with @apangin. Following tests could be adapted:

    test/jdk/jdk/jfr/event/io/TestSocketEvents.java
    test/jdk/jdk/jfr/event/io/TestSocketChannelEvents.java
    test/jdk/jdk/jfr/event/io/TestSocketAdapterEvents.java

[JDK-8308995]: https://bugs.openjdk.org/browse/JDK-8308995

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

PR Comment: https://git.openjdk.org/jdk/pull/33860#issuecomment-6956712877

Reply via email to