maven-resolver tread-safe? Calling resolveDependencies in multiple threads

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

maven-resolver tread-safe? Calling resolveDependencies in multiple threads

Andreas Sewe-2
Hi,

is maven-resolver (specifically resolveDependencies) thread safe? I know
that it places .lock files to avoid multiple threads trampling on each
others partial downloads, but I seem to have encountered a deadlock (or
some other phenomenon that causes it to hang).

Here's an excerpt from a stack dump I took:

> "BasicRepositoryConnector-uk.maven.org-2-1" #21 daemon prio=5 os_prio=31 tid=0x00007f80609a6800 nid=0x5803 waiting on condition [0x000000011ca65000]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
> at java.lang.Thread.sleep(Native Method)
> at org.eclipse.aether.connector.basic.PartialFile$LockFile.lock(PartialFile.java:113)
> at org.eclipse.aether.connector.basic.PartialFile$LockFile.<init>(PartialFile.java:69)
> at org.eclipse.aether.connector.basic.PartialFile$Factory.newInstance(PartialFile.java:278)
> at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:438)
> at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:360)
> at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
>
> "BasicRepositoryConnector-uk.maven.org-2-0" #20 daemon prio=5 os_prio=31 tid=0x00007f805e21f800 nid=0x300b waiting on condition [0x000000011c962000]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
> at java.lang.Thread.sleep(Native Method)
> at org.eclipse.aether.connector.basic.PartialFile$LockFile.lock(PartialFile.java:113)
> at org.eclipse.aether.connector.basic.PartialFile$LockFile.<init>(PartialFile.java:69)
> at org.eclipse.aether.connector.basic.PartialFile$Factory.newInstance(PartialFile.java:278)
> at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:438)
> at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:360)
> at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
>
> "ForkJoinPool-1-worker-0" #17 daemon prio=5 os_prio=31 tid=0x00007f805ea24800 nid=0x5507 waiting on condition [0x00000001716f3000]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
> at java.lang.Thread.sleep(Native Method)
> at org.eclipse.aether.connector.basic.PartialFile$LockFile.lock(PartialFile.java:113)
> at org.eclipse.aether.connector.basic.PartialFile$LockFile.<init>(PartialFile.java:69)
> at org.eclipse.aether.connector.basic.PartialFile$Factory.newInstance(PartialFile.java:278)
> at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:438)
> at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:360)
> at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
> at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:583)
> at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:259)
> at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:498)
> at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:399)
> at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
> at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:338)
>
> "ForkJoinPool-1-worker-3" #16 daemon prio=5 os_prio=31 tid=0x00007f805ea34800 nid=0x500b waiting on condition [0x000000011cb88000]
>    java.lang.Thread.State: WAITING (parking)
> at sun.misc.Unsafe.park(Native Method)
> at java.util.concurrent.locks.LockSupport.park(LockSupport.java:304)
> at org.eclipse.aether.util.concurrency.RunnableErrorForwarder.awaitTerminationOfAllRunnables(RunnableErrorForwarder.java:137)
> at org.eclipse.aether.util.concurrency.RunnableErrorForwarder.await(RunnableErrorForwarder.java:104)
> at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:262)
> at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:498)
> at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:399)
> at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
> at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:338)
Could it be that the threads hold onto their .lock files crosswise?,
causing a deadlock?

Best wishes,

Andreas


signature.asc (836 bytes) Download Attachment