[ 
https://issues.apache.org/jira/browse/MNG-8014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17808367#comment-17808367
 ] 

Guillaume Nodet commented on MNG-8014:
--------------------------------------

The current multithreaded project builder implementation is wrong. 

In its design, it can cause the fork join pool to deadlock. Deadlock can occur 
when a task is waiting for the result of another task that is waiting for the 
resources locked by the first task, resulting in a circular dependency. 

A way to solve the problem would be use async/await constructs: Java 8 
introduced CompletableFuture, which provides async/await-like features. By 
utilising these constructs, we can asynchronously wait for multiple task 
results without blocking the ForkJoinPool's threads. 

> Maven concurrent model builder deadlocks
> ----------------------------------------
>
>                 Key: MNG-8014
>                 URL: https://issues.apache.org/jira/browse/MNG-8014
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 4.0.0-alpha-10
>            Reporter: Guillaume Nodet
>            Priority: Major
>
> Building [https://github.com/gnodet/quarkus/tree/maven-deadlock] with Maven 
> 4.0.0-alpha-12 deadlocks.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to