On Mon, 13 Oct 2025 05:17:06 GMT, Jaikiran Pai <[email protected]> wrote:

>> This is a very subtle detail, shall we document the rationale for 
>> `Reference.reachabilityFence(conn)`?
>
> Hello Volkan, I've now added a comment in the test methods to explain why 
> this line is present.

Technically the reachabilityFence should be in the finally clause of a 
try-finally to make sure it's not rearranged away by JIT - but I'm not sure how 
important this is for a test like this. Alternative could be to stash the 
reference in a static field. As long as the test methods are not run in 
parallel that should work too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27633#discussion_r2426003503

Reply via email to