[jdk8u-dev] RFR: 8295982: Failure in sun/security/tools/keytool/WeakAlg.java - ks: The process cannot access the file because it is being used by another process

Dmitry Cherepanov dcherepanov at openjdk.org
Tue Nov 1 09:28:51 UTC 2022


On Sat, 29 Oct 2022 21:25:40 GMT, Roman Marchenko <rmarchenko at openjdk.org> wrote:

> Test sun/security/tools/keytool/WeakAlg.java occasionally fails on Windows 64 bit (win2016, win11) with the following message "java.nio.file.FileSystemException: ks: The process cannot access the file because it is being used by another process".
> 
> The root cause of the problem is "ks" file is still open by FileInputStream instance used by KeyStore in the test code. Perhaps, forcing GC to run may avoid this issue, but I guess explicit closing of the input stream is more suitable here.
> 
> No regression, only the test code is changed.
> The test passes on Windows and Linux now.

Marked as reviewed by dcherepanov (Reviewer).

Looks good.  It seems that it's introduced by the patch for 8182879 (confidential bug). Just for the reference, 8u patch with this issue https://github.com/openjdk/jdk8u-dev/commit/a2d837f50cc792cbbce56aa3892a169ff5f7b297 and 11u patch without this issue https://github.com/openjdk/jdk11u-dev/commit/7cf3c0ff1482d23494f88a0eaf13a821adc0bc47

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

PR: https://git.openjdk.org/jdk8u-dev/pull/150


More information about the jdk8u-dev mailing list