[ 
https://issues.apache.org/jira/browse/TIKA-4575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18045537#comment-18045537
 ] 

Tim Allison commented on TIKA-4575:
-----------------------------------

We were trying to obtain a lock to read the final directory. So, even if we 
managed to correctly unzip the plugins dir in the forking process which we were 
doing in the AsyncProcessor, the forked processes could run into contention on 
Windows simply checking for whether the unzipped directory existed.

We need to rework this a bit.

> Race condition in CI windows with unzipping pf4j plugin
> -------------------------------------------------------
>
>                 Key: TIKA-4575
>                 URL: https://issues.apache.org/jira/browse/TIKA-4575
>             Project: Tika
>          Issue Type: Task
>            Reporter: Tim Allison
>            Priority: Minor
>
> We recently had what look like race conditions in unzipping pf4j plugins in 
> tika-app unit tests on github.
> The exception looks like this:
> {noformat}
> org.apache.tika.pipes.core.ServerInitializationException: 
> java.io.FileNotFoundException: 
> D:\a\tika\tika\tika-app\target\plugins\tika-pipes-file-system-4.0.0-SNAPSHOT.zip.lock
>  (The process cannot access the file because it is being used by another 
> process)
>       at java.base/java.io.RandomAccessFile.open0(Native Method)
>       at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:344)
>       at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:259)
>       at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:213)
>       at 
> org.apache.tika.plugins.ThreadSafeUnzipper.unzipPlugin(ThreadSafeUnzipper.java:47)
>       at 
> org.apache.tika.plugins.TikaPluginManager.unzip(TikaPluginManager.java:135)
>       at 
> org.apache.tika.plugins.TikaPluginManager.init(TikaPluginManager.java:119)
>       at 
> org.apache.tika.plugins.TikaPluginManager.<init>(TikaPluginManager.java:97)
>       at 
> org.apache.tika.plugins.TikaPluginManager.load(TikaPluginManager.java:79)
>       at 
> org.apache.tika.pipes.core.server.PipesServer.initializeResources(PipesServer.java:455)
>       at 
> org.apache.tika.pipes.core.server.PipesServer.load(PipesServer.java:175)
>       at 
> org.apache.tika.pipes.core.server.PipesServer.main(PipesServer.java:241) 
> {noformat}
> We need to add more, ahem, safety to the ThreadSafeUnzipper.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to