You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2026/08/24 05:28:34 UTC
(maven) branch backport/12748-to-maven-4.0.x created (now a39245109d)
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a change to branch backport/12748-to-maven-4.0.x
in repository https://gitbox.apache.org/repos/asf/maven.git
at a39245109d Fix #12599: BuildPlanExecutor thread pool leak on constructor failure
This branch includes the following new commits:
new a39245109d Fix #12599: BuildPlanExecutor thread pool leak on constructor failure
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(maven) 01/01: Fix #12599: BuildPlanExecutor thread pool leak on constructor failure
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch backport/12748-to-maven-4.0.x
in repository https://gitbox.apache.org/repos/asf/maven.git
commit a39245109dcfa3b7c42dbca0b56932f105bc4334
Author: ulofiai <ul...@protonmail.com>
AuthorDate: Mon Aug 24 13:02:56 2026 +0800
Fix #12599: BuildPlanExecutor thread pool leak on constructor failure
Build the initial plan before creating the PhasingExecutor. If plan
construction throws, BuildContext now fails before allocating the
executor, so cleanup cannot be skipped. The change is limited to the
initialization order in BuildPlanExecutor.
Closes #12748
---
.../apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java b/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java
index 62136c0cc1..55c10f8fa4 100644
--- a/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java
+++ b/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java
@@ -211,10 +211,10 @@ class BuildContext implements AutoCloseable {
session.getProjects().size());
// Propagate the parallel flag to the root session
session.setParallel(threads > 1);
- this.executor = new PhasingExecutor(Executors.newFixedThreadPool(threads, new BuildThreadFactory()));
- // build initial plan
+ // Build the initial plan before creating the executor so constructor failures cannot leak it.
this.plan = buildInitialPlan(taskSegments);
+ this.executor = new PhasingExecutor(Executors.newFixedThreadPool(threads, new BuildThreadFactory()));
}
BuildContext() {