elharo opened a new issue, #12605:
URL: https://github.com/apache/maven/issues/12605

   # DefaultProjectBuildingHelper: Synchronized bottleneck in parallel builds
   
   **Found in:** maven-4.0.x branch
   **File:** 
`impl/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java`
 (line 117)
   **Severity:** Medium
   
   ## Description
   
   The entire `createProjectRealm()` method is `synchronized`, making it a 
global lock during multi-module parallel builds:
   
   ```java
   @Override
   public synchronized ProjectRealmCache.CacheRecord createProjectRealm(
           MavenProject project, Model model, ProjectBuildingRequest request)
   ```
   
   During a multi-module build where many projects need extension realms set up 
concurrently, each must acquire this lock serially. Since the inner 
`projectRealmCache` uses `ConcurrentHashMap` and is already thread-safe, the 
synchronization could be narrowed to just the non-thread-safe portions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to