Skip to content

Fix: make ProjectIndex thread-safe for parallel builds (backport #12832) - #12927

Merged
gnodet merged 1 commit into
maven-3.10.xfrom
backport/12832-3.10.x
Aug 30, 2026
Merged

Fix: make ProjectIndex thread-safe for parallel builds (backport #12832)#12927
gnodet merged 1 commit into
maven-3.10.xfrom
backport/12832-3.10.x

Conversation

@gnodet

@gnodet gnodet commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #12832 to maven-3.10.x.

  • Switch ProjectIndex backing maps from HashMap to ConcurrentHashMap to fix root cause of index corruption under parallel builds (-T)
  • Add null guards for both indices and projects lookups with enriched error messages mentioning parallel builds and extensions as possible causes

Test plan

  • CI green

🤖 Generated with Claude Code

Backport of #12832 to maven-3.10.x. Switch ProjectIndex backing maps from
HashMap to ConcurrentHashMap to fix root cause of index corruption under
parallel builds (-T). Add null guards for both index and project lookups
with enriched error messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet added this to the 3.10.0 milestone Aug 30, 2026
@gnodet gnodet added bug Something isn't working mvn3 backport labels Aug 30, 2026

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Clean backport of #12832 to maven-3.10.x. The adaptation is correct — on master a null guard already existed and was only enhanced, whereas on maven-3.10.x the code had bare auto-unboxing with no null guard, so introducing both the ConcurrentHashMap switch and the full null guards from scratch is the right approach.

Observations (informational):

  • File paths correctly use the maven-3.10.x layout (maven-core/...) rather than the master layout (impl/maven-core/...)
  • The Integer idx + null check + int index = idx pattern correctly prevents NPE from auto-unboxing
  • All three maintenance branches are covered: #12926 (maven-4.0.x), #12927 (maven-3.10.x), #12928 (maven-3.9.x)

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Guillaume Nodet

@gnodet
gnodet merged commit 910cdc2 into maven-3.10.x Aug 30, 2026
16 checks passed
@gnodet
gnodet deleted the backport/12832-3.10.x branch August 30, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working mvn3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant