Skip to content

Lazy initialization of recommendation providers is not thread-safe for multiproject builds with --parallel #78

@cbue

Description

@cbue

Hi!

The recommendation plugin traverses up the project hierarchy to find a suitable recommendation in one of the parent projects, which is a good feature.

But as soon as the "--parallel" switch comes into play, a common parant project recommendation container gets requested by multiple threads in parallel.

My builds fail because a not completely preinitialized recommendation-HashMap is returned by the MavenBomRecommendationProvider in those situations.

Currenly we only use the MavenBomRecommendationProvider but by reviewing the code I found the same issue in:

  • MavenBomRecommendationProvider
  • DependencyLockProvider.groovy
  • IvyRecommendationProvider.groovy
  • PropertyFileRecommendationProvider.java

I will prepare two pull requests with fixes. One for the MavenBomRecommendationProvider which I tested successfully in my project and another one for the other three fixes.

Could you please review my code changes and merge the changes if suitable?

Thanks!

Regards
Christian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions