[GRADLE-3027] Gradle may hang due to synchronization issue inside ivy's code related to WeakHashMap cache Created: 17/Feb/14  Updated: 25/Nov/15  Resolved: 25/Nov/15

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 2.10-rc-1

Type: Bug
Reporter: Szczepan Faber Assignee: Unassigned
Resolution: Fixed Votes: 1


 Description   

Gradle may hang due to synchronization issue inside ivy's code related to WeakHashMap cache. The effect visible to the user is that the build hangs and jstack output will show that one thread is busy doing this:

at java.util.WeakHashMap.get(WeakHashMap.java:355)
	at org.apache.ivy.core.module.id.ModuleId.intern(ModuleId.java:63)
	at org.apache.ivy.core.module.id.ModuleId.newInstance(ModuleId.java:48)
	at org.apache.ivy.core.module.id.ModuleRevisionId.newInstance(ModuleRevisionId.java:106)
	at org.gradle.api.internal.artifacts.ivyservice.IvyUtil.createModuleRevisionId(IvyUtil.java:45)

This can happen only in --parallel builds. Ivy's code internally uses static WeakHashMap cache that is buggy: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6425537



 Comments   
Comment by Sterling Greene [ 18/Nov/15 ]

https://discuss.gradle.org/t/build-hangs-randomly-with-gradle-2-8-similar-to-gradle-3027/12823

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