[GRADLE-2486] Parallel build fails with random Ivy resolution errors Created: 19/Sep/12 Updated: 04/Jan/13 Resolved: 02/Nov/12
We have a multi-project build with 30+ subprojects and we are using Ivy to resolve dependencies. The Ivy repository is located both on local and on a shared network file system for which we defined custom resolvers.
With Gradle 1.2 the single threaded build works as expected however with the --parallel option we got random Ivy resolution errors.
More specifically the errors are all java.text.ParseExceptions but the exception message and the Ivy module where it occurs is random.
Some example exceptions:
java.text.ParseException: Problem occurred while parsing ivy file: multiple points in file:////<SOME_PATH>/ivy-1.5.2.xml
java.text.ParseException: Problem occurred while parsing ivy file: For input string: ".2001122E4.2001122E4" in file:////<SOME_PATH>/ivy-2012.07.10.xml
java.text.ParseException: Problem occurred while parsing ivy file: For input string: "" in file:////<SOME_PATH>/ivy-1.1.1.xml
I've attached a full exception from one of the builds. It looks to be a concurrency issue when multiple threads are trying to resolve dependencies. Unfortunately I cannot provide a reproduction project as it requires a large number of projects and dependencies so that it occurs.
|Comment by Szabolcs Póta [ 25/Sep/12 ]|
We managed to find the code where concurrent access causes the above described failure during parallel build. It is the org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.DownloadedIvyModuleDescriptorParser#parseDescriptor(...) method. When this is made synchronized, our build succeeds:
Maybe concurrency can be handled in a more fine grained manner but at the moment it helped us use and test parallel build. We would appreciate this fix in the upcoming releases.
|Comment by Peter Walker (Inactive) [ 28/Sep/12 ]|
We expect this to be addressed in 1.3.
|Comment by Szabolcs Póta [ 01/Oct/12 ]|
Thank you. We are looking forward to the fix.