sonatype / ossindex-maven

Sonatype OSS Index - Maven Integrations
https://sonatype.github.io/ossindex-maven/
Apache License 2.0
11 stars 11 forks source link

threading issue? #63

Open delanym opened 2 years ago

delanym commented 2 years ago

Is this a threadsafe issue with v3.2.0 of org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies

java.nio.channels.OverlappingFileLockException                                                                                                                                                                     
    at sun.nio.ch.SharedFileLockTable.checkList (FileLockTable.java:255)                                                                                                                                               at sun.nio.ch.SharedFileLockTable.add (FileLockTable.java:152)                                                                                                                                                 
    at sun.nio.ch.FileChannelImpl.lock (FileChannelImpl.java:1062)                                       
    at org.sonatype.ossindex.service.client.util.FileLocker.lock (FileLocker.java:59)                                                                                                                              
    at org.sonatype.ossindex.service.client.util.FileLocker.writeLock (FileLocker.java:88)                                                                                                                             at org.sonatype.ossindex.service.client.cache.DirectoryCache.storeEntry (DirectoryCache.java:247)                                                                                                              
    at org.sonatype.ossindex.service.client.cache.DirectoryCache.putAll (DirectoryCache.java:136)                                                                                                                      at org.sonatype.ossindex.service.client.internal.OssindexClientImpl.requestComponentReports (OssindexClientImpl.java:171)                                                                                      
    at org.sonatype.ossindex.maven.common.ComponentReportAssistant.request (ComponentReportAssistant.java:86)                                                                                                          at org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies$Task.run (BanVulnerableDependencies.java:222)                                                                                                
    at org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies.execute (BanVulnerableDependencies.java:144)                                                                                                     at org.apache.maven.plugins.enforcer.EnforceMojo.execute (EnforceMojo.java:200)                                                                                                                                
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)                                                                                                              at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)                                                                                                                            
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)                                                                                                                                at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)                                                                                                                            
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)                                                                                                       at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)                                                                                       
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)                                                                                       
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)                                                                                                                                                   
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)                                                                                                                                    
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)

then I got a lot of these

[WARNING] Failed to fetch component-reports
org.sonatype.ossindex.service.client.transport.Transport$TransportException: Unexpected response; status: HTTP/1.1 429 Too Many Requests
    at org.sonatype.ossindex.service.client.transport.HttpClientTransport.post (HttpClientTransport.java:102)
    at org.sonatype.ossindex.service.client.internal.OssindexClientImpl.doRequestComponentReports (OssindexClientImpl.java:204)
    at org.sonatype.ossindex.service.client.internal.OssindexClientImpl.requestComponentReports (OssindexClientImpl.java:170)
    at org.sonatype.ossindex.maven.common.ComponentReportAssistant.request (ComponentReportAssistant.java:86)
    at org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies$Task.run (BanVulnerableDependencies.java:222)
    at org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies.execute (BanVulnerableDependencies.java:144)
    at org.apache.maven.plugins.enforcer.EnforceMojo.execute (EnforceMojo.java:200)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)
jdillon commented 2 years ago

probably related https://github.com/sonatype/ossindex-maven/issues/18