From ebb9b68044abd359378f0a0be00bd526e1a445aa Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian Date: Wed, 28 Oct 2026 17:39:27 +0000 Subject: [PATCH 1/5] chore(kokoro): fix java8-osx lock acquisition failure Fix 'Could not acquire lock(s)' on Mac OS java8-osx builds during Maven install by passing -Daether.syncContext.named.factory=nolock to -T 1C parallel invocations. --- .kokoro/build.sh | 8 ++++---- .kokoro/common.sh | 8 ++++---- .kokoro/dashboard.sh | 2 +- .kokoro/dependencies.sh | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index ecdd0a3ea514..472697c4131c 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -70,7 +70,7 @@ case ${JOB_TYPE} in -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \ -Dmaven.wagon.http.retryHandler.count=5 \ "${EXCLUDE_PROJECTS_OPTS[@]}" \ - -T 1C + -T 1C -Daether.syncContext.named.factory=nolock RETURN_CODE=$? if [[ -n "${BUILD_SUBDIR}" ]] @@ -97,7 +97,7 @@ case ${JOB_TYPE} in -Dmaven.wagon.http.retryHandler.count=5 \ -DskipTests=true \ --also-make \ - -T 1C + -T 1C -Daether.syncContext.named.factory=nolock fi ;; integration) @@ -317,12 +317,12 @@ case ${JOB_TYPE} in # benchmark module in java-bigquery/benchmark. This module is not needed during # other builds or releases. mvn -B -ntp \ - -T 1C \ + -T 1C -Daether.syncContext.named.factory=nolock \ ${MODULE_FILTER} \ -Dlint \ com.spotify.fmt:fmt-maven-plugin:check mvn -B -ntp \ - -T 1C \ + -T 1C -Daether.syncContext.named.factory=nolock \ ${MODULE_FILTER} \ -Dlint \ checkstyle:check@checkstyle diff --git a/.kokoro/common.sh b/.kokoro/common.sh index 84e36200685f..7f9f9fa55961 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -458,7 +458,7 @@ function run_integration_tests() { -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \ -DskipUnitTests=true \ -Dmaven.wagon.http.retryHandler.count=5 \ - -T 1C + -T 1C -Daether.syncContext.named.factory=nolock RETURN_CODE=$? printf "Finished integration tests for modules:\n%s\n" "$1" @@ -546,7 +546,7 @@ function install_modules() { -DskipTests=true \ -Dmaven.javadoc.skip=true \ -Dgcloud.download.skip=true \ - -T 1C + -T 1C -Daether.syncContext.named.factory=nolock else printf "Installing modules:\n%s\n" "$1" parse_all_submodules "$1" @@ -625,7 +625,7 @@ function install_modules() { -DskipTests=true \ -Dmaven.javadoc.skip=true \ -Dgcloud.download.skip=true \ - -T 1C + -T 1C -Daether.syncContext.named.factory=nolock fi } @@ -723,5 +723,5 @@ function install_repo_modules { fi echo "Installing this repo's modules to local maven." mvn -q -B -ntp install ${projects_arg} \ - -Dcheckstyle.skip -Dfmt.skip -DskipTests -T 1C + -Dcheckstyle.skip -Dfmt.skip -DskipTests -T 1C -Daether.syncContext.named.factory=nolock } diff --git a/.kokoro/dashboard.sh b/.kokoro/dashboard.sh index 0a7fb642eb53..3f101b2b51e7 100755 --- a/.kokoro/dashboard.sh +++ b/.kokoro/dashboard.sh @@ -26,7 +26,7 @@ if [[ "${JOB_TYPE}" == "dashboard-units-check" ]]; then mvn test --fail-at-end elif [[ "${JOB_TYPE}" == "dependency-convergence-check" ]]; then echo -e "\n******************** BUILDING DEPENDENCIES ********************" - mvn install -B -ntp -T 1C -Pquick-build -DskipTests -Denforcer.skip=true + mvn install -B -ntp -T 1C -Daether.syncContext.named.factory=nolock -Pquick-build -DskipTests -Denforcer.skip=true cd java-cloud-bom/tests/dependency-convergence/ echo -e "\n******************** RUNNING DEPENDENCY CONVERGENCE CHECK ********************" mvn validate --fail-at-end diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 9dd9ecd55355..14efdcf56742 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -67,9 +67,9 @@ fi # produces the required bytecode in target/classes and target/test-classes in seconds. # 3. Why -DskipTests=true? Ensures test classes are compiled without executing tests during analysis. mvn test-compile -B -V -ntp \ - -Pquick-build -DskipTests=true -Dmaven.javadoc.skip=true -Denforcer.skip=false -T 1C + -Pquick-build -DskipTests=true -Dmaven.javadoc.skip=true -Denforcer.skip=false -T 1C -Daether.syncContext.named.factory=nolock -mvn -B dependency:analyze -Pquick-build -DfailOnWarning=true -Dmdep.analyze.skip=false -T 1C +mvn -B dependency:analyze -Pquick-build -DfailOnWarning=true -Dmdep.analyze.skip=false -T 1C -Daether.syncContext.named.factory=nolock if [[ -n "${BUILD_SUBDIR}" ]] then From 7d77d23c5c51e6ae2e805deec431ecbe40caab63 Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian Date: Wed, 28 Oct 2026 17:51:48 +0000 Subject: [PATCH 2/5] Addressed comments --- .kokoro/build.sh | 8 ++++---- .kokoro/common.sh | 9 +++++---- .kokoro/dashboard.sh | 2 +- .kokoro/dependencies.sh | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 472697c4131c..ecdd0a3ea514 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -70,7 +70,7 @@ case ${JOB_TYPE} in -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \ -Dmaven.wagon.http.retryHandler.count=5 \ "${EXCLUDE_PROJECTS_OPTS[@]}" \ - -T 1C -Daether.syncContext.named.factory=nolock + -T 1C RETURN_CODE=$? if [[ -n "${BUILD_SUBDIR}" ]] @@ -97,7 +97,7 @@ case ${JOB_TYPE} in -Dmaven.wagon.http.retryHandler.count=5 \ -DskipTests=true \ --also-make \ - -T 1C -Daether.syncContext.named.factory=nolock + -T 1C fi ;; integration) @@ -317,12 +317,12 @@ case ${JOB_TYPE} in # benchmark module in java-bigquery/benchmark. This module is not needed during # other builds or releases. mvn -B -ntp \ - -T 1C -Daether.syncContext.named.factory=nolock \ + -T 1C \ ${MODULE_FILTER} \ -Dlint \ com.spotify.fmt:fmt-maven-plugin:check mvn -B -ntp \ - -T 1C -Daether.syncContext.named.factory=nolock \ + -T 1C \ ${MODULE_FILTER} \ -Dlint \ checkstyle:check@checkstyle diff --git a/.kokoro/common.sh b/.kokoro/common.sh index 7f9f9fa55961..f65c06a4561e 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -1,5 +1,6 @@ #!/bin/bash # Copyright 2020 Google LLC +export MAVEN_OPTS="${MAVEN_OPTS} -Daether.syncContext.named.factory=nolock" # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -458,7 +459,7 @@ function run_integration_tests() { -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \ -DskipUnitTests=true \ -Dmaven.wagon.http.retryHandler.count=5 \ - -T 1C -Daether.syncContext.named.factory=nolock + -T 1C RETURN_CODE=$? printf "Finished integration tests for modules:\n%s\n" "$1" @@ -546,7 +547,7 @@ function install_modules() { -DskipTests=true \ -Dmaven.javadoc.skip=true \ -Dgcloud.download.skip=true \ - -T 1C -Daether.syncContext.named.factory=nolock + -T 1C else printf "Installing modules:\n%s\n" "$1" parse_all_submodules "$1" @@ -625,7 +626,7 @@ function install_modules() { -DskipTests=true \ -Dmaven.javadoc.skip=true \ -Dgcloud.download.skip=true \ - -T 1C -Daether.syncContext.named.factory=nolock + -T 1C fi } @@ -723,5 +724,5 @@ function install_repo_modules { fi echo "Installing this repo's modules to local maven." mvn -q -B -ntp install ${projects_arg} \ - -Dcheckstyle.skip -Dfmt.skip -DskipTests -T 1C -Daether.syncContext.named.factory=nolock + -Dcheckstyle.skip -Dfmt.skip -DskipTests -T 1C } diff --git a/.kokoro/dashboard.sh b/.kokoro/dashboard.sh index 3f101b2b51e7..0a7fb642eb53 100755 --- a/.kokoro/dashboard.sh +++ b/.kokoro/dashboard.sh @@ -26,7 +26,7 @@ if [[ "${JOB_TYPE}" == "dashboard-units-check" ]]; then mvn test --fail-at-end elif [[ "${JOB_TYPE}" == "dependency-convergence-check" ]]; then echo -e "\n******************** BUILDING DEPENDENCIES ********************" - mvn install -B -ntp -T 1C -Daether.syncContext.named.factory=nolock -Pquick-build -DskipTests -Denforcer.skip=true + mvn install -B -ntp -T 1C -Pquick-build -DskipTests -Denforcer.skip=true cd java-cloud-bom/tests/dependency-convergence/ echo -e "\n******************** RUNNING DEPENDENCY CONVERGENCE CHECK ********************" mvn validate --fail-at-end diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 14efdcf56742..9dd9ecd55355 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -67,9 +67,9 @@ fi # produces the required bytecode in target/classes and target/test-classes in seconds. # 3. Why -DskipTests=true? Ensures test classes are compiled without executing tests during analysis. mvn test-compile -B -V -ntp \ - -Pquick-build -DskipTests=true -Dmaven.javadoc.skip=true -Denforcer.skip=false -T 1C -Daether.syncContext.named.factory=nolock + -Pquick-build -DskipTests=true -Dmaven.javadoc.skip=true -Denforcer.skip=false -T 1C -mvn -B dependency:analyze -Pquick-build -DfailOnWarning=true -Dmdep.analyze.skip=false -T 1C -Daether.syncContext.named.factory=nolock +mvn -B dependency:analyze -Pquick-build -DfailOnWarning=true -Dmdep.analyze.skip=false -T 1C if [[ -n "${BUILD_SUBDIR}" ]] then From b65f0ff670e87de104ad5958a2593e441844a914 Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian Date: Wed, 28 Oct 2026 17:58:14 +0000 Subject: [PATCH 3/5] Addressed comments --- .kokoro/common.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.kokoro/common.sh b/.kokoro/common.sh index f65c06a4561e..c4a82fa1b051 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -1,6 +1,5 @@ #!/bin/bash # Copyright 2020 Google LLC -export MAVEN_OPTS="${MAVEN_OPTS} -Daether.syncContext.named.factory=nolock" # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,6 +13,10 @@ export MAVEN_OPTS="${MAVEN_OPTS} -Daether.syncContext.named.factory=nolock" # See the License for the specific language governing permissions and # limitations under the License. +# Disable Maven local repository locking to avoid "Could not acquire lock(s)" +# failures during parallel (-T 1C) builds. +export MAVEN_OPTS="${MAVEN_OPTS} -Daether.syncContext.named.factory=nolock" + commonScriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") excluded_modules=( 'gapic-libraries-bom' From a344b0221794203c41b2b19168a0558c35677b9f Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian Date: Wed, 28 Oct 2026 18:03:44 +0000 Subject: [PATCH 4/5] Addressed comments --- .kokoro/common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.kokoro/common.sh b/.kokoro/common.sh index c4a82fa1b051..b99a650d9e27 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Disable Maven local repository locking to avoid "Could not acquire lock(s)" -# failures during parallel (-T 1C) builds. -export MAVEN_OPTS="${MAVEN_OPTS} -Daether.syncContext.named.factory=nolock" +# Raise the Maven resolver named-lock timeout (default 30s) to avoid +# "Could not acquire lock(s)" failures during parallel (-T 1C) builds. +export MAVEN_OPTS="${MAVEN_OPTS:-} -Daether.syncContext.named.time=300" commonScriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") excluded_modules=( From 41820f8d8c4bad7f15421c300d0eaa8312c05b51 Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian Date: Fri, 30 Oct 2026 17:54:30 +0000 Subject: [PATCH 5/5] Addressed comments --- .kokoro/common.sh | 4 ---- .mvn/maven.config | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.kokoro/common.sh b/.kokoro/common.sh index b99a650d9e27..84e36200685f 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -13,10 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Raise the Maven resolver named-lock timeout (default 30s) to avoid -# "Could not acquire lock(s)" failures during parallel (-T 1C) builds. -export MAVEN_OPTS="${MAVEN_OPTS:-} -Daether.syncContext.named.time=300" - commonScriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") excluded_modules=( 'gapic-libraries-bom' diff --git a/.mvn/maven.config b/.mvn/maven.config index 2495b1a3668f..e2ac57dd9106 100644 --- a/.mvn/maven.config +++ b/.mvn/maven.config @@ -1,2 +1,3 @@ -Daether.remoteRepositoryFilter.prefixes=false -Daether.remoteRepositoryFilter.groupId=false +-Daether.syncContext.named.time=900