[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: RFR: 8307536: FileAlreadyExistsException from NativeLibLoader when running concurrent applicatio
From:       Andy Goryachev <angorya () openjdk ! org>
Date:       2023-07-31 16:54:50
Message-ID: aOQMKtM5IIfmNqt0mUMcRr1UEUAIZQNarcogST1S5oU=.48ff3ee6-1c03-4fd8-b257-7fe514f01a0a () github ! com
[Download RAW message or body]

On Fri, 28 Jul 2023 09:11:07 GMT, Jose Pereda <jpereda@openjdk.org> wrote:

> This PR adds a file lock to the cache directory, allowing access from multiple \
> processes (that is, from more than one JVM) to that directory.  
> This helps solving the issue where the cache is empty or doesn't exist yet, and two \
> JavaFX applications start at the same time, and both try to copy the same native \
> libraries to the same cache. 
> No tests have been added to the PR though, since this requires a complex scenario: \
> building the SDK and publishing to local Maven repository, creating two simple \
> JavaFX applications that use those artifacts, using a temporary folder for cache \
> (via `javafx.cachedir`, and launching in parallel both applications. 
> I've tested successfully such scenario on Linux, Mac and Windows.

modules/javafx.graphics/src/main/java/com/sun/glass/utils/NativeLibLoader.java line \
311:

> 309:                  FileLock fileLock = fileChannel.lock()) {
> 310:                 try {
> 311:                     if (!Files.exists(path)) {

This code would fail if the target file exists but has a 0 length, or any length \
other that the actual resource length, or with the right length but wrong content.   \
Do we want to address these scenarios?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1188#discussion_r1279611539


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic