You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2020/03/17 22:16:53 UTC

[kudu] branch master updated: [build] Fix buildSrc lock timeout

This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 33fdea5  [build] Fix buildSrc lock timeout
33fdea5 is described below

commit 33fdea56517463b9c61b51b2618059f5ec8e0fda
Author: Grant Henke <gr...@apache.org>
AuthorDate: Tue Mar 17 16:31:34 2020 -0500

    [build] Fix buildSrc lock timeout
    
    I have seen a few instances where the `make` build fails in a fresh
    environment with the below error about a buildSrc lock:
    
    `Timeout waiting to lock buildSrc build lock. It is currently in use by another Gradle instance.`
    
    However, I have not seen this at all in pre-commit builds where
    the environment isn’t wiped or in developer environments.
    
    I think the issue is that building the buildSrc module for the first time
    takes too long because it needs to pull dependencies and doesn’t
    have a cache to use.
    
    This patch adds an extra step in the cmake Gradle initialization
    to actually call a project task to ensure the buildSrc module is
    initialized.
    
    Change-Id: I26444e6d2f8fffca1d070a591710bd7382063624
    Reviewed-on: http://gerrit.cloudera.org:8080/15470
    Reviewed-by: Andrew Wong <aw...@cloudera.com>
    Tested-by: Kudu Jenkins
---
 CMakeLists.txt    | 1 +
 java/build.gradle | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a56fb5..df592b1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -107,6 +107,7 @@ list(REMOVE_DUPLICATES GRADLE_FLAGS)
 set(GRADLE_WRAPPER_JAR ${JAVA_DIR}/gradle/wrapper/gradle-wrapper.jar)
 add_custom_command(OUTPUT ${GRADLE_WRAPPER_JAR}
   COMMAND ./gradlew --version ${GRADLE_FLAGS}
+  COMMAND ./gradlew initializeTasks ${GRADLE_FLAGS}
   WORKING_DIRECTORY "${JAVA_DIR}")
 add_custom_target(init_gradle DEPENDS ${GRADLE_WRAPPER_JAR})
 
diff --git a/java/build.gradle b/java/build.gradle
index 035fff8..7514176 100755
--- a/java/build.gradle
+++ b/java/build.gradle
@@ -66,6 +66,13 @@ subprojects {
   }
 }
 
+// A task that does nothing, but is useful to ensure the Gradle build and tasks are initialized.
+task initializeTasks() {
+  doLast {
+    println("Initialized Gradle tasks")
+  }
+}
+
 task javadocAggregate(type: Javadoc, group: "Documentation") {
   description = "Generates Aggregate Javadoc API documentation for the main source code."
   source subprojects.collect { it.sourceSets.main.allJava }