Skip to content

Fix configuration resolution lock conflicts in parallel builds for Gradle 9#139

Merged
rpalcolea merged 3 commits intomainfrom
more-gradle-9-work
Jul 3, 2025
Merged

Fix configuration resolution lock conflicts in parallel builds for Gradle 9#139
rpalcolea merged 3 commits intomainfrom
more-gradle-9-work

Conversation

@rpalcolea
Copy link
Member

Fix configuration resolution lock conflicts in parallel builds for Gradle 9

Resolves configuration resolution exclusive lock exceptions that occurred
when multiple subprojects attempted to resolve BOM configurations
simultaneously in parallel builds with Gradle 9.

Key changes:

  • Add BomResolverService build service to resolve BOMs once per build
    and cache results by BOM coordinates for reuse across projects
  • Implement eager BOM resolution during afterEvaluate phase when
    exclusive locks are available, preventing resolution during
    dependency resolution phase
  • Cache recommendations by BOM coordinates instead of project paths
    to handle different subprojects with different BOM configurations

Fixes failing test: "recommendation is defined in root and we can see
proper reasons in submodule dependency insight" in parallel builds.

@rpalcolea rpalcolea requested review from OdysseusLives and chali July 1, 2025 22:50
netflix.nebula.dependency.recommender.provider.MavenBomRecommendationProvider mavenBomProvider = container.getMavenBomProvider();
if (mavenBomProvider != null) {
try {
mavenBomProvider.getVersion("dummy", "dummy"); // Trigger lazy initialization
Copy link
Member

Choose a reason for hiding this comment

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

hehe this version

* @param configuration the Gradle configuration containing BOM dependencies
* @return a unique cache key based on the BOM coordinates
*/
private String createBomKeyFromConfiguration(Configuration configuration) {
Copy link
Member

Choose a reason for hiding this comment

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

🎉

@rpalcolea rpalcolea force-pushed the more-gradle-9-work branch from 9afb519 to 1766d1a Compare July 2, 2025 23:47
@rpalcolea rpalcolea merged commit 1163b3e into main Jul 3, 2025
10 checks passed
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