>
> the concurrent builder is experimental in 4.0.0

Indeed, possible performance issues on a huge project shouldn't be a
blocker to release 4.0.
But I'd still try to fix these problems before the release, as such fixes
may require redesign and break the back compatibility.

In the meanwhile I've updated my
https://github.com/maven-turbo-reactor/maven-timeline-extension - it now
supports the concurrent builder (since version 1.0, just released today).
I believe you can find valuable build insights in it. E.g. while mouse
hovering the goal there is a black frame highlighting all goals of the same
module.
So you can compare the standard multithreaded builder (all goals go
one-after-another, see the black frame):
[image: Screenshot 2026-11-30 at 10.27.58.jpg]

vs turbo builder (eagerly schedules downstream dependencies not waiting for
test compilation and execution, also single black frame)
[image: Screenshot 2026-11-30 at 10.28.22.jpg]

vs concurrent builder (executes goals on separate worker threads, many
black frames)
[image: Screenshot 2026-11-30 at 10.28.45.jpg]

You can see a live preview here:
https://maven-turbo-reactor.github.io/maven-timeline-extension/build-report.html
(this report is for the multithreaded builder)

Thx for the report !
> I've raised https://github.com/apache/maven/pull/14186 which should
> fix the problem.

Thanks. I checked it and commented on the PR - there are still issues with
it (even the latest 7c242d6bfc358d070360e0055ac035e6e703f8bc). Will try to
provide a reproducer.
Note: current maven-4.0.x branch (commit
1364474a90c7d2367e84124751dce956458e88f4) -bconcurrent build is valid,
successful, but just slow.

On Sun, Nov 29, 2026 at 7:15 PM Matthias Bünger via dev <
[email protected]> wrote:

> Hi Sergey,
>
> I'm not the one to go into technical details, but I only want to
> highlight that the concurrent builder is experimental in 4.0.0.
>
> Have a great evening
>
> Matthias
>
> Am 29.11.2026 um 16:24 schrieb Sergey Chernov:
> > I've seen the suggestion to get rid of MultiThreadedBuilder in one of the
> > recent topics (which I strongly advise not to do (-1), at least not in
> 4.0),
> > so I decided to recheck the current state of the concurrent builder
> > (-bconcurrent) for our project.
> >
> > The 4.0.0-rc-7 simply failed with an error which seems to be fixed in the
> > current maven-4.0.x branch:
> >
> > [ERROR] The builder requested using id = concurrent cannot be found ->
> [Help
> > 1]
> >
> > org.apache.maven.lifecycle.internal.builder.BuilderNotFoundException: The
> > builder requested using id = concurrent cannot be found
> >
> >      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (
> > LifecycleStarter.java:108)
> >
> >      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
> >
> >      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
> >
> >      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
> >
> >      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:919)
> >
> >      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:285)
> >
> >      at org.apache.maven.cli.MavenCli.main (MavenCli.java:207)
> >
> >      at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (
> > DirectMethodHandleAccessor.java:104)
> >
> >      at java.lang.reflect.Method.invoke (Method.java:565)
> >
> >      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
> (
> > Launcher.java:255)
> >
> >      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (
> > Launcher.java:201)
> >
> >      at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (
> > Launcher.java:361)
> >
> >      at org.codehaus.plexus.classworlds.launcher.Launcher.main (
> > Launcher.java:314)
> >
> >
> > Tried with the latest build from the branch, now this failure above is
> > gone, but the build performance is quite poor.
> > For comparison, simple mvn validate -bmultithreaded takes 0.5 sec on both
> > 3.9.16 and 4.0.0-SNAPSHOT, but it takes 80 seconds for mvn validate
> > -bconcurrent. Worth to mention: in the reproducer the validate has
> > literally 0 mapped plugin goals, so this is a pure builder overhead.
> >
> > In the past I've shared the server_subset reproducer project with Tamas
> and
> > Guillaume. I've rechecked, it still shows the problem.
> > I made a small Claude analysis, below is the machine output:
> >
> >> The build isn't deadlocked. It finished with BUILD SUCCESS, but it spent
> >> minutes with the six builder threads at about 100% CPU. The log sat
> still
> >> for long stretches, which is why it looks hung.
> > What the dumps show
> >> - All 6 BuilderThread-* threads are RUNNABLE in every snapshot. They sit
> >> in BuildPlanExecutor$BuildContext.executePlan at lines 542–544, inside
> >> stream().allMatch(BuildStep::isDone). Each has used about 3s of CPU per
> >> snapshot interval.
> >> - The main thread is parked in PhasingExecutor.close, waiting for those
> >> builders.
> >> - No threads are blocked on locks, and jstack reports no deadlock.
> > Likely root cause: a quadratic scheduler in the concurrent builder
> >> (-bconcurrent)
> >> - After every step finishes, the thread that ran it calls executePlan()
> >> (BuildPlanExecutor.java:~513). That call scans plan.sortedNodes() and,
> for
> >> each node still in CREATED state, runs predecessors.allMatch(isDone).
> >> - This repo has about 1,100 modules, and each module has many lifecycle
> >> steps (setup, plan, each phase, teardown, and the after:* steps). So the
> >> plan has tens of thousands of nodes.
> >> - Every completed step triggers a full scan of all not-yet-started
> nodes.
> >> That is O(steps²) work in total.
> >> - Steps that end up skipped call executePlan() recursively, which makes
> it
> >> worse.
> >> - The scan holds the read lock. The plan() call takes the write lock on
> >> each module's PLAN step, so the scans and the planning steps block each
> >> other.
> >> - The Skipping Rule Enforcement lines for config-tools show the log is
> >> moving, but each real step is swamped by scheduling overhead.
> >
> >> Possible fixes
> >> - Maintain a ready queue or a per-step counter of unfinished
> predecessors
> >> that is decremented on completion, instead of rescanning the whole plan.
> >> - Only scan the successors of the step that just finished.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to