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

Michael Osipov edited comment on MRESOLVER-123 at 6/30/20, 9:15 AM:
--------------------------------------------------------------------

Hi Michael. The code looks reasonable to me although I find it a little bit 
awkward that the lock lives in the factory.
Unfortunately it produces the following Exception for every artifact download:

{noformat}
[main] [WARNING] Could not validate integrity of download from 
https://nexus-mirror.acme.com/nexus/content/groups/releases/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom
org.eclipse.aether.transfer.ChecksumFailureException: Checksum validation 
failed, expected 
1bcea46372e9256cbeb68b1bde54a4730120cf6e135861abe76272e5107ede9c but is 
09b999a969e73525a6cc3ad2868ea744766e1d93b25c6c656d61a5ff9c881da9
    at 
org.eclipse.aether.connector.basic.ChecksumValidator.validateExternalChecksums 
(ChecksumValidator.java:174)
    at org.eclipse.aether.connector.basic.ChecksumValidator.validate 
(ChecksumValidator.java:103)
    at 
org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask
 (BasicRepositoryConnector.java:460)
    at 
org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run 
(BasicRepositoryConnector.java:364)
    at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run 
(RunnableErrorForwarder.java:75)
    at 
org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute
 (BasicRepositoryConnector.java:644)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get 
(BasicRepositoryConnector.java:262)
    at 
org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads 
(DefaultArtifactResolver.java:499)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve 
(DefaultArtifactResolver.java:401)
    at 
org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts 
(DefaultArtifactResolver.java:229)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact 
(DefaultArtifactResolver.java:207)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel 
(DefaultModelResolver.java:172)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel 
(DefaultModelResolver.java:222)
    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally 
(DefaultModelBuilder.java:1070)
    at org.apache.maven.model.building.DefaultModelBuilder.readParent 
(DefaultModelBuilder.java:846)
    at org.apache.maven.model.building.DefaultModelBuilder.build 
(DefaultModelBuilder.java:337)
    at 
org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom 
(DefaultArtifactDescriptorReader.java:292)
    at 
org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor
 (DefaultArtifactDescriptorReader.java:171)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.resolveCachedArtifactDescriptor
 (DefaultDependencyCollector.java:538)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.getArtifactDescriptorResult
 (DefaultDependencyCollector.java:523)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency
 (DefaultDependencyCollector.java:410)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency
 (DefaultDependencyCollector.java:362)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process 
(DefaultDependencyCollector.java:349)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies
 (DefaultDependencyCollector.java:254)
    at 
org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies 
(DefaultRepositorySystem.java:284)
    at 
org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolveInternal
 (DefaultPluginDependenciesResolver.java:205)
    at 
org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve 
(DefaultPluginDependenciesResolver.java:152)
    at 
org.apache.maven.plugin.internal.DefaultMavenPluginManager.resolveExtensionArtifacts
 (DefaultMavenPluginManager.java:911)
    at 
org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupExtensionsRealm 
(DefaultMavenPluginManager.java:842)
    at org.apache.maven.project.DefaultProjectBuildingHelper.createProjectRealm 
(DefaultProjectBuildingHelper.java:197)
    at 
org.apache.maven.project.DefaultModelBuildingListener.buildExtensionsAssembled 
(DefaultModelBuildingListener.java:101)
    at org.apache.maven.model.building.ModelBuildingEventCatapult$1.fire 
(ModelBuildingEventCatapult.java:44)
    at org.apache.maven.model.building.DefaultModelBuilder.fireEvent 
(DefaultModelBuilder.java:1368)
    at org.apache.maven.model.building.DefaultModelBuilder.build 
(DefaultModelBuilder.java:460)
    at org.apache.maven.model.building.DefaultModelBuilder.build 
(DefaultModelBuilder.java:440)
    at org.apache.maven.project.DefaultProjectBuilder.build 
(DefaultProjectBuilder.java:618)
    at org.apache.maven.project.DefaultProjectBuilder.build 
(DefaultProjectBuilder.java:387)
    at org.apache.maven.graph.DefaultGraphBuilder.collectProjects 
(DefaultGraphBuilder.java:414)
    at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor 
(DefaultGraphBuilder.java:405)
    at org.apache.maven.graph.DefaultGraphBuilder.build 
(DefaultGraphBuilder.java:82)
    at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:507)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:219)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
(Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
(Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
(Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main 
(Launcher.java:347)
{noformat}


was (Author: rreich):
Hi Michael. The code looks reasonable to me although I find it a little bit 
awkward that the lock lives in the factory.
Unfortunately it produces the following Exception for every artifact download:

```
[main] [WARNING] Could not validate integrity of download from 
https://nexus-mirror.acme.com/nexus/content/groups/releases/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom
org.eclipse.aether.transfer.ChecksumFailureException: Checksum validation 
failed, expected 
1bcea46372e9256cbeb68b1bde54a4730120cf6e135861abe76272e5107ede9c but is 
09b999a969e73525a6cc3ad2868ea744766e1d93b25c6c656d61a5ff9c881da9
    at 
org.eclipse.aether.connector.basic.ChecksumValidator.validateExternalChecksums 
(ChecksumValidator.java:174)
    at org.eclipse.aether.connector.basic.ChecksumValidator.validate 
(ChecksumValidator.java:103)
    at 
org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask
 (BasicRepositoryConnector.java:460)
    at 
org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run 
(BasicRepositoryConnector.java:364)
    at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run 
(RunnableErrorForwarder.java:75)
    at 
org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute
 (BasicRepositoryConnector.java:644)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get 
(BasicRepositoryConnector.java:262)
    at 
org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads 
(DefaultArtifactResolver.java:499)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve 
(DefaultArtifactResolver.java:401)
    at 
org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts 
(DefaultArtifactResolver.java:229)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact 
(DefaultArtifactResolver.java:207)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel 
(DefaultModelResolver.java:172)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel 
(DefaultModelResolver.java:222)
    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally 
(DefaultModelBuilder.java:1070)
    at org.apache.maven.model.building.DefaultModelBuilder.readParent 
(DefaultModelBuilder.java:846)
    at org.apache.maven.model.building.DefaultModelBuilder.build 
(DefaultModelBuilder.java:337)
    at 
org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom 
(DefaultArtifactDescriptorReader.java:292)
    at 
org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor
 (DefaultArtifactDescriptorReader.java:171)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.resolveCachedArtifactDescriptor
 (DefaultDependencyCollector.java:538)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.getArtifactDescriptorResult
 (DefaultDependencyCollector.java:523)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency
 (DefaultDependencyCollector.java:410)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency
 (DefaultDependencyCollector.java:362)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process 
(DefaultDependencyCollector.java:349)
    at 
org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies
 (DefaultDependencyCollector.java:254)
    at 
org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies 
(DefaultRepositorySystem.java:284)
    at 
org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolveInternal
 (DefaultPluginDependenciesResolver.java:205)
    at 
org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve 
(DefaultPluginDependenciesResolver.java:152)
    at 
org.apache.maven.plugin.internal.DefaultMavenPluginManager.resolveExtensionArtifacts
 (DefaultMavenPluginManager.java:911)
    at 
org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupExtensionsRealm 
(DefaultMavenPluginManager.java:842)
    at org.apache.maven.project.DefaultProjectBuildingHelper.createProjectRealm 
(DefaultProjectBuildingHelper.java:197)
    at 
org.apache.maven.project.DefaultModelBuildingListener.buildExtensionsAssembled 
(DefaultModelBuildingListener.java:101)
    at org.apache.maven.model.building.ModelBuildingEventCatapult$1.fire 
(ModelBuildingEventCatapult.java:44)
    at org.apache.maven.model.building.DefaultModelBuilder.fireEvent 
(DefaultModelBuilder.java:1368)
    at org.apache.maven.model.building.DefaultModelBuilder.build 
(DefaultModelBuilder.java:460)
    at org.apache.maven.model.building.DefaultModelBuilder.build 
(DefaultModelBuilder.java:440)
    at org.apache.maven.project.DefaultProjectBuilder.build 
(DefaultProjectBuilder.java:618)
    at org.apache.maven.project.DefaultProjectBuilder.build 
(DefaultProjectBuilder.java:387)
    at org.apache.maven.graph.DefaultGraphBuilder.collectProjects 
(DefaultGraphBuilder.java:414)
    at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor 
(DefaultGraphBuilder.java:405)
    at org.apache.maven.graph.DefaultGraphBuilder.build 
(DefaultGraphBuilder.java:82)
    at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:507)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:219)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
(Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
(Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
(Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main 
(Launcher.java:347)
```

> Concurrency issues
> ------------------
>
>                 Key: MRESOLVER-123
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-123
>             Project: Maven Resolver
>          Issue Type: Bug
>          Components: resolver
>    Affects Versions: 1.4.2
>            Reporter: Michael Osipov
>            Priority: Critical
>
> This is an umbrella ticket for a long standing issue with Maven Resolver: Our 
> concurrency support is mediocre in a way that if two or more threads try to 
> download the same file and fail to queue those write actions nicely. The 
> problem is that The {{SyncContext}} and the its factory provided by Maven 
> Resolver does not employ any locking at all. As layed out in detail in 
> MRESOLVER-114 we need striped read write locks on artifacts and its metadata. 
> This issue shall track progress on it. Even Takari Concurrent Repository 
> extension does not help because it is only intended to synchronize concurrent 
> access by multple JVMs and not threads.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to