RFR: 8367561: Getting some "header" property from a file:// URL causes a file descriptor leak [v3]
Jaikiran Pai
jpai at openjdk.org
Tue Oct 14 10:37:37 UTC 2025
On Mon, 13 Oct 2025 11:15:30 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> 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.
>
> Otherwise LGTM
I decided to store the `URLConnection` instance as a class level field instead of a try/finally with `Reference.reachabilityFence()` in the finally. With that change, I also decided to use Volkan's suggestion of using a `@ParameterizedTest` for some of these test methods.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27633#discussion_r2428678538
More information about the net-dev
mailing list