It works on one of my smaller projects that facing the same issue.

However, in order to test with a bigger project, I need an official
3.9.2-SNAPSHOT deployed at apache (long story)

Thank you for the quick fix

-D

On Thu, Mar 23, 2023 at 4:27 AM Tamás Cservenák <ta...@cservenak.net> wrote:

> You could try out this one, if you can:
> Resolver PR:
> https://github.com/apache/maven-resolver/pull/272
> Then build Maven 3.9.x using built resolver (just modify the POM to use
> resolver 1.9.8-SNAPSHOT)
> https://github.com/apache/maven/tree/maven-3.9.x
>
> https://issues.apache.org/jira/browse/MRESOLVER-346
>
> If you want "baked" ZIP, just ping.
>
> Thanks
> T
>
> On Thu, Mar 23, 2023 at 11:34 AM Tamás Cservenák <ta...@cservenak.net>
> wrote:
>
> > Dan,
> >
> > iI I provide you with a patched Maven ZIP, or,
> > if I point you to two PRs (one in resolver and one in maven-3.9.x) to
> > build patched Maven locally,
> > could you stick that patched Maven into your env just to try it out?
> >
> > Thanks
> > T
> >
> > On Thu, Mar 23, 2023 at 9:37 AM Tamás Cservenák <ta...@cservenak.net>
> > wrote:
> >
> >> Ok,
> >>
> >> this is def a timeout on lock:
> >>
> >>
> https://github.com/apache/maven-resolver/blob/e439b343d8d94bdcc82965a3d4f2584c31c319c0/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/synccontext/named/NamedLockFactoryAdapter.java#L157-L158
> >>
> >> Pls increase the timeout.
> >>
> >> T
> >>
> >> On Thu, Mar 23, 2023 at 9:32 AM Dan Tran <dant...@gmail.com> wrote:
> >>
> >>> this is not a single threaded buld
> >>>
> >>> stack trace:
> >>>
> >>> *9:35:34*  [ERROR] Could not acquire write lock for
> >>> 'artifact:ch.qos.logback:logback-classic:1.2.10'*09:35:34*
> >>> java.lang.IllegalStateException: Could not acquire write lock for
> >>> 'artifact:ch.qos.logback:logback-classic:1.2.10'*09:35:34*      at
> >>>
> >>>
> org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapter$AdaptedLockSyncContext.acquire
> >>> (NamedLockFactoryAdapter.java:158)*09:35:34*      at
> >>>
> org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts
> >>> (DefaultArtifactResolver.java:259)*09:35:34*      at
> >>>
> >>>
> org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies
> >>> (DefaultRepositorySystem.java:352)*09:35:34*      at
> >>>
> >>>
> org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolveInternal
> >>> (DefaultPluginDependenciesResolver.java:212)*09:35:34*      at
> >>>
> >>>
> org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve
> >>> (DefaultPluginDependenciesResolver.java:158)*09:35:34*      at
> >>>
> >>>
> org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPluginRealm
> >>> (DefaultMavenPluginManager.java:372)*09:35:34*      at
> >>>
> >>>
> org.apache.maven.plugin.internal.DefaultMavenPluginManager.lambda$setupPluginRealm$1
> >>> (DefaultMavenPluginManager.java:335)*09:35:34*      at
> >>> org.apache.maven.plugin.DefaultPluginRealmCache.lambda$get$0
> >>> (DefaultPluginRealmCache.java:156)*09:35:34*      at
> >>> java.util.concurrent.ConcurrentHashMap.computeIfAbsent
> >>> (ConcurrentHashMap.java:1737)*09:35:34*      at
> >>> org.apache.maven.plugin.DefaultPluginRealmCache.get
> >>> (DefaultPluginRealmCache.java:154)*09:35:34*      at
> >>>
> >>>
> org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPluginRealm
> >>> (DefaultMavenPluginManager.java:334)*09:35:34*      at
> >>> org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm
> >>> (DefaultBuildPluginManager.java:205)*09:35:34*      at
> >>> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
> >>> (DefaultBuildPluginManager.java:98)*09:35:34*      at
> >>> org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2
> >>> (MojoExecutor.java:342)*09:35:34*      at
> >>> org.apache.maven.lifecycle.internal.MojoExecutor.doExecute
> >>> (MojoExecutor.java:330)*09:35:34*      at
> >>> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> >>> (MojoExecutor.java:213)*09:35:34*      at
> >>> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> >>> (MojoExecutor.java:175)*09:35:34*      at
> >>> org.apache.maven.lifecycle.internal.MojoExecutor.access$000
> >>> (MojoExecutor.java:76)*09:35:34*      at
> >>> org.apache.maven.lifecycle.internal.MojoExecutor$1.run
> >>> (MojoExecutor.java:163)*09:35:34*      at
> >>> org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute
> >>> (DefaultMojosExecutionStrategy.java:39)*09:35:34*      at
> >>> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> >>> (MojoExecutor.java:160)*09:35:34*      at
> >>> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
> >>> (LifecycleModuleBuilder.java:105)*09:35:34*      at
> >>>
> >>>
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call
> >>> (MultiThreadedBuilder.java:193)*09:35:34*      at
> >>>
> >>>
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call
> >>> (MultiThreadedBuilder.java:180)*09:35:34*      at
> >>> java.util.concurrent.FutureTask.run (FutureTask.java:264)*09:35:34*
> >>>   at java.util.concurrent.Executors$RunnableAdapter.call
> >>> (Executors.java:515)*09:35:34*      at
> >>> java.util.concurrent.FutureTask.run (FutureTask.java:264)*09:35:34*
> >>>   at java.util.concurrent.ThreadPoolExecutor.runWorker
> >>> (ThreadPoolExecutor.java:1128)*09:35:34*      at
> >>> java.util.concurrent.ThreadPoolExecutor$Worker.run
> >>> (ThreadPoolExecutor.java:628)*09:35:34*      at java.lang.Thread.run
> >>> (Thread.java:829)*09:35:34*  [ERROR] java.lang.IllegalStateException:
> >>> Could not acquire write lock for
> >>> 'artifact:ch.qos.logback:logback-classic:1.2.10'*09:35:34*
> >>> java.util.concurrent.ExecutionException:
> >>> java.lang.IllegalStateException: Could not acquire write lock for
> >>> 'artifact:ch.qos.logback:logback-classic:1.2.10'*09:35:34*      at
> >>> java.util.concurrent.FutureTask.report (FutureTask.java:122)*09:35:34*
> >>>      at java.util.concurrent.FutureTask.get
> >>> (FutureTask.java:191)*09:35:34*      at
> >>>
> >>>
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder.multiThreadedProjectTaskSegmentBuild
> >>> (MultiThreadedBuilder.java:140)*09:35:34*      at
> >>>
> >>>
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder.build
> >>> (MultiThreadedBuilder.java:101)*09:35:34*      at
> >>> org.apache.maven.lifecycle.internal.LifecycleStarter.execute
> >>> (LifecycleStarter.java:118)*09:35:34*      at
> >>> org.apache.maven.DefaultMaven.doExecute
> >>> (DefaultMaven.java:261)*09:35:34*      at
> >>> org.apache.maven.DefaultMaven.doExecute
> >>> (DefaultMaven.java:173)*09:35:34*      at
> >>> org.apache.maven.DefaultMaven.execute
> >>> (DefaultMaven.java:101)*09:35:34*      at
> >>> org.apache.maven.cli.MavenCli.execute (MavenCli.java:827)*09:35:34*
> >>>   at org.apache.maven.cli.MavenCli.doMain
> >>> (MavenCli.java:272)*09:35:34*      at
> >>> org.apache.maven.cli.MavenCli.main (MavenCli.java:195)*09:35:34*
> >>> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native
> >>> Method)*09:35:34*      at
> >>> jdk.internal.reflect.NativeMethodAccessorImpl.invoke
> >>> (NativeMethodAccessorImpl.java:62)*09:35:34*      at
> >>> jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke
> >>> (DelegatingMethodAccessorImpl.java:43)*09:35:34*      at
> >>> java.lang.reflect.Method.invoke (Method.java:566)*09:35:34*      at
> >>> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
> >>> (Launcher.java:282)*09:35:34*      at
> >>> org.codehaus.plexus.classworlds.launcher.Launcher.launch
> >>> (Launcher.java:225)*09:35:34*      at
> >>> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
> >>> (Launcher.java:406)*09:35:34*      at
> >>> org.codehaus.plexus.classworlds.launcher.Launcher.main
> >>> (Launcher.java:347)*09:35:34*      at
> >>> jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native
> >>> Method)*09:35:34*      at
> >>> jdk.internal.reflect.NativeMethodAccessorImpl.invoke
> >>> (NativeMethodAccessorImpl.java:62)*09:35:34*      at
> >>> jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke
> >>> (DelegatingMethodAccessorImpl.java:43)*09:35:34*      at
> >>> java.lang.reflect.Method.invoke (Method.java:566)*09:35:34*      at
> >>> org.apache.maven.wrapper.BootstrapMainStarter.start
> >>> (BootstrapMainStarter.java:52)*09:35:34*      at
> >>> org.apache.maven.wrapper.WrapperExecutor.execute
> >>> (WrapperExecutor.java:161)*09:35:34*      at
> >>> org.apache.maven.wrapper.MavenWrapperMain.main
> >>> (MavenWrapperMain.java:73)
> >>>
> >>>
> >>> thanks
> >>>
> >>>
> >>> -D
> >>>
> >>>
> >>> On Wed, Mar 22, 2023 at 3:23 PM Tamás Cservenák <ta...@cservenak.net>
> >>> wrote:
> >>>
> >>> > Interesting.
> >>> >
> >>> > You did not provide any stack, so I just guessed "timeout". For
> >>> > increasing/decreasing "wait time" (def is 30 sec), see here:
> >>> > https://maven.apache.org/resolver/configuration.html
> >>> > Look for "aether.syncContext.named.time" and
> >>> > "aether.syncContext.named.time.unit".
> >>> > Also good to look at:
> >>> >
> >>>
> https://maven.apache.org/resolver/maven-resolver-named-locks/index.html
> >>> >
> >>> > And finally, there are redisson and hazelcast provided locks:
> >>> >
> >>> >
> >>>
> https://maven.apache.org/resolver/maven-resolver-named-locks-redisson/index.html
> >>> >
> >>> > Also, "So I guess it is using the default file-lock?" -- Maven 3.9.1
> >>> does
> >>> > NOT use file locking by default, so unless the docker image you use,
> or
> >>> > whatever sets it up....
> >>> > It would be good to see some stack and what locking is in use.
> >>> >
> >>> > Note: if it turns out you don't use file locking, but the default
> >>> (Maven
> >>> > 3.9.1 by default uses in-jvm "rwlock-local" (backed by
> ReadWriteLock),
> >>> then
> >>> > really just increase time....
> >>> >
> >>> > How about concurrency, I guess this is not a single threaded build?
> >>> >
> >>> > T
> >>> >
> >>> > PS: Is late here, my response to your response will probably come in
> my
> >>> > morning
> >>> >
> >>> > On Wed, Mar 22, 2023 at 11:08 PM Dan Tran <dant...@gmail.com> wrote:
> >>> >
> >>> > > Thanks for the quick response
> >>> > >
> >>> > > This is a simple switch from 3.8.7 to 3.9.1 ( did not see this
> issue
> >>> when
> >>> > > tested with  3.9.0). So I guess it is using the default file-lock?
> >>> > >
> >>> > > The build runs inside a docker container on Jenkins agent with no
> >>> > antivirus
> >>> > > checker. The build always starts from scratch
> >>> > >
> >>> > > artifact:ch.qos.logback:logback-classic:1.2.10  is common artifact
> >>> > > used by all components
> >>> > >
> >>> > >
> >>> > > How do I increase timeout?
> >>> > >
> >>> > >
> >>> > > Thanks
> >>> > >
> >>> > >
> >>> > > -D
> >>> > >
> >>> > >
> >>> > > On Wed, Mar 22, 2023 at 11:44 AM Tamás Cservenák <
> >>> ta...@cservenak.net>
> >>> > > wrote:
> >>> > >
> >>> > > > Howdy Dan,
> >>> > > >
> >>> > > > You did not mention what locking implementation you use, what
> >>> params
> >>> > etc?
> >>> > > > file-lock? redisson? something else?
> >>> > > >
> >>> > > > At the same time, it is rather strange that you mention "at the
> >>> same
> >>> > > > artifact" thing... from here and below I will assume you use file
> >>> > locks:
> >>> > > > - can you do something like lsof on Linux? Meaning, can you
> ensure
> >>> > > nothing
> >>> > > > (some app, IDE or antivirus) is keeping the file open?
> >>> > > > - can you tell a bit more about that artifact? Is it installed
> one?
> >>> > Maybe
> >>> > > > from the current build? A dependency? In case of HUGE build and
> >>> COMMON
> >>> > > > artifact (ie. slf4j-api) that is used in almost all modules may
> be
> >>> > "hot",
> >>> > > > maybe try to increase lock timeout? Or even radically lessen
> (that
> >>> > should
> >>> > > > make problem occur more often perhaps)
> >>> > > >
> >>> > > > HTH
> >>> > > > Tamas
> >>> > > >
> >>> > > > On Wed, Mar 22, 2023 at 7:32 PM Dan Tran <dant...@gmail.com>
> >>> wrote:
> >>> > > >
> >>> > > > > Hi
> >>> > > > >
> >>> > > > > My large 400+ modules build facing the mentioned locking issue
> >>> > > > consistently
> >>> > > > > at the same artifact
> >>> > > > >
> >>> > > > > artifact:ch.qos.logback:logback-classic:1.2.10
> >>> > > > >
> >>> > > > >
> >>> > > > > any one see this issue at your build?
> >>> > > > >
> >>> > > > >
> >>> > > > > Thanks
> >>> > > > >
> >>> > > > >
> >>> > > > > -D
> >>> > > > >
> >>> > > > >
> >>> > > > > dont see same issue at smaller build
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> >>
>

Reply via email to