[GRADLE-1724] Dependency resolution against SSL repo hang and make m4 unusable Created: 05/Aug/11  Updated: 04/Jan/13  Resolved: 10/Feb/12

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-4
Fix Version/s: 1.0-milestone-7

Type: Bug
Reporter: Hani Suleiman Assignee: Daz DeBoer
Resolution: Fixed Votes: 0


 Description   

More often than not, when running gradle m4 and having it resolve dependencies, the process will hang and never complete. Deleting .gradle does nothing, the only 'fix' is to remove all the project's dependencies from ~/.gradle/cache/artifacts.

The stack trace of the hung process (relevant blocking thread):

"main" prio=5 tid=7fbdab001000 nid=0x106fc9000 runnable [106fc5000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:798)

  • locked <7f329f4e8> (a java.lang.Object)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:755)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
  • locked <7f329f5e8> (a com.sun.net.ssl.internal.ssl.AppInputStream)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
  • locked <7f3321080> (a java.io.BufferedInputStream)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
  • locked <7f42b0478> (a sun.net.www.protocol.https.DelegateHttpsURLConnection)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318)
    at org.jfrog.wharf.ivy.handler.WharfUrlHandler.checkStatusCode(WharfUrlHandler.java:381)
    at org.jfrog.wharf.ivy.handler.WharfUrlHandler.getURLInfo(WharfUrlHandler.java:85)
    at org.jfrog.wharf.ivy.handler.WharfUrlHandler.getURLInfo(WharfUrlHandler.java:66)
    at org.jfrog.wharf.ivy.resource.WharfUrlResource.init(WharfUrlResource.java:112)
    at org.jfrog.wharf.ivy.resource.WharfUrlResource.exists(WharfUrlResource.java:152)
    at org.apache.ivy.plugins.resolver.RepositoryResolver.findResourceUsingPattern(RepositoryResolver.java:97)
    at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findResourceUsingPatterns(AbstractPatternsBasedResolver.java:93)
    at org.apache.ivy.plugins.resolver.IBiblioResolver.findIvyFileRef(IBiblioResolver.java:102)
    at org.jfrog.wharf.ivy.resolver.IBiblioWharfResolver.findIvyFileRef(IBiblioWharfResolver.java:90)
    at org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:223)
    at org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(IBiblioResolver.java:503)
    at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104)
    at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104)
    at org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:169)
    at org.apache.ivy.core.resolve.VisitNode.loadData(VisitNode.java:287)
    at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:696)
    at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:781)
    at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:704)
    at org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:576)
    at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:237)
    at org.apache.ivy.Ivy.resolve(Ivy.java:512)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver.resolve(DefaultIvyDependencyResolver.java:55)
    at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:43)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyService.resolve(DefaultIvyService.java:122)
    at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsIvyService.resolve(ShortcircuitEmptyConfigsIvyService.java:69)
    at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingIvyService.resolve(ErrorHandlingIvyService.java:47)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:209)
  • locked <7f4ae3060> (a java.lang.Object)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:471)
  • locked <7f4ae3060> (a java.lang.Object)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:179)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:183)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:101)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:73)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:174)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:96)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:73)
    at org.gradle.api.internal.file.CompositeFileCollection$1.resolve(CompositeFileCollection.java:88)
    at org.gradle.api.internal.file.CompositeFileCollection.getSourceCollections(CompositeFileCollection.java:143)
    at org.gradle.api.internal.file.CompositeFileTree.getSourceCollections(CompositeFileTree.java:30)
    at org.gradle.api.internal.file.CompositeFileCollection.getFiles(CompositeFileCollection.java:38)
    at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:59)
    at org.gradle.api.internal.changedetection.DefaultFileSnapshotter.snapshot(DefaultFileSnapshotter.java:42)
    at org.gradle.api.internal.changedetection.InputFilesChangedUpToDateRule.create(InputFilesChangedUpToDateRule.java:35)
    at org.gradle.api.internal.changedetection.CompositeUpToDateRule.create(CompositeUpToDateRule.java:35)
    at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.calcCurrentState(DefaultTaskArtifactStateRepository.java:106)
    at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.isUpToDate(DefaultTaskArtifactStateRepository.java:114)
    at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:154)
    at org.gradle.api.internal.changedetection.ShortCircuitTaskArtifactStateRepository$1.isUpToDate(ShortCircuitTaskArtifactStateRepository.java:35)
    at org.gradle.api.internal.changedetection.FileCacheBroadcastTaskArtifactStateRepository$1.isUpToDate(FileCacheBroadcastTaskArtifactStateRepository.java:37)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:44)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
    at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:237)
    at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:167)


 Comments   
Comment by Hani Suleiman [ 05/Aug/11 ]

By the way some of the time this is due to the url request not working, is it possible to add a timeout (something quite short) so that the build fails quickly?

Comment by Adam Murdoch [ 05/Aug/11 ]

A (short) timeout is an excellent idea - for all types of remote repositories. Could you add a separate jira issue for that?

Comment by Hani Suleiman [ 06/Aug/11 ]

Added http://issues.gradle.org/browse/GRADLE-1728

Comment by Daz DeBoer [ 09/Feb/12 ]

Hani - there were critical issues with caching and dependency resolution in Milestone 4, some of which continued into later milestones. But now (Milestone 8), we feel like the primary issues have been resolved.

Have you tried a more recent Gradle version to see if this issue persists? I'm keen to close this one if it's no longer a problem.

Comment by Hani Suleiman [ 09/Feb/12 ]

I have, and all of these issues have been resolved in m7. Thank you!

Generated at Wed Jun 30 12:02:46 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.