RFR: 8283719: java/util/logging/CheckZombieLockTest.java failing intermittently [v2]
Alan Bateman
alanb at openjdk.java.net
Fri Apr 8 17:12:31 UTC 2022
On Fri, 8 Apr 2022 17:08:25 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Please find enclosed a patch for
>> `8283719: java/util/logging/CheckZombieLockTest.java failing intermittently`
>>
>> My analysis is that the test fails intermittently because the `FileChannel` created by the test is garbage collected too early, which releases the associated lock before the `FileHandler` is created.
>> I have replaced the `try { } finally { }` with a `try-with-resource( ) { } finally { }` which will prevent the `FileChannel` from being released before the end of the block. Additional bonus: this should also help with the code that tries to cleanup the files at the end.
>>
>> Though I haven't been able to reproduce the exact failure yet, I haven't observed the new version of the test failing either.
>
> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>
> Incorporated review comments
Looks fine, you can drop use of getAbsolutePath if you want to, not important here.
-------------
Marked as reviewed by alanb (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/8168
More information about the core-libs-dev
mailing list