Skip to content

chore(kokoro): fix java8-osx lock acquisition failure - #14812

Merged
sakthivelmanii merged 5 commits into
mainfrom
chore-kokoro-java8-osx
Oct 30, 2026
Merged

sakthivelmanii merged 5 commits into
mainfrom
chore-kokoro-java8-osx

Conversation

@sakthivelmanii

@sakthivelmanii sakthivelmanii commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • Parallel (-T 1C) Maven installs on slower macOS runners can wait longer than the resolver named-lock timeout (30s by default before Maven 3.9.12) and fail with Could not acquire lock(s).

Solution

  • Set -Daether.syncContext.named.time=900 in .mvn/maven.config, matching the Maven 3.9.12+ default, so every Maven invocation in the repo gets the longer lock wait regardless of the Maven version installed on the runner or how scripts set MAVEN_OPTS. Resolver locking stays enabled.

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.
@sakthivelmanii
sakthivelmanii requested a review from a team as a code owner October 28, 2026 17:39
@sakthivelmanii
sakthivelmanii enabled auto-merge (squash) October 28, 2026 17:39
@sakthivelmanii

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request appends the -Daether.syncContext.named.factory=nolock flag to multiple Maven commands across several Kokoro shell scripts. The reviewer noted that disabling locking during multi-threaded builds (-T 1C) introduces concurrency risks, such as local repository corruption. To improve maintainability and reduce duplication, the reviewer recommended centralizing this configuration by exporting it via MAVEN_OPTS in a common setup script instead of modifying each individual Maven invocation.

Comment thread .kokoro/build.sh Resolved

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the -Daether.syncContext.named.factory=nolock flag to multiple Maven commands across several Kokoro shell scripts (build.sh, common.sh, dashboard.sh, and dependencies.sh) to prevent locking issues during parallel builds. The reviewer suggests defining this option globally using the MAVEN_OPTS environment variable in a shared script like common.sh to avoid code duplication and keep individual Maven commands clean.

Comment thread .kokoro/common.sh Resolved
@sakthivelmanii

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the .kokoro/common.sh script to append -Daether.syncContext.named.factory=nolock to the MAVEN_OPTS environment variable. The feedback recommends using ${MAVEN_OPTS:-} to avoid potential unbound variable errors in environments where set -u is enabled.

Comment thread .kokoro/common.sh Resolved
@sakthivelmanii

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the .kokoro/common.sh script to increase the Maven resolver named-lock timeout to 300 seconds by setting the MAVEN_OPTS environment variable. This change aims to prevent 'Could not acquire lock(s)' failures during parallel builds. There are no review comments, and I have no additional feedback to provide.

Comment thread .kokoro/common.sh Resolved
@sakthivelmanii
sakthivelmanii merged commit 919a4db into main Oct 30, 2026
195 checks passed
@sakthivelmanii
sakthivelmanii deleted the chore-kokoro-java8-osx branch October 30, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants