Skip to content

Conversation

@cstamas
Copy link
Member

@cstamas cstamas commented Oct 21, 2025

When --raw-streams is used (especially when combined with options like --quiet and -DforceStdout) there is no guarantee that anything touches terminal. Hence, in case of embedded executor it is quite possible that cached/warm code arrives quickly at the place that would do system out before the thread with FastTerminal finishes system install.

In other words, when --raw-streams are used, we cannot guarantee that system streams are already properly set up. This PR changes that, and makes sure (by triggering a dummy call to terminal), at the cost of "jline3 install lag" for CLI invocation. OTOH, this lag in case of embedded executors does not exists (it exists only on first invocation).

My suspicion that this is the cause of IT instability issues, when Verifier used Toolbox output ends up on Surefire stdout and not on "grabbed" output, as simply streams are not yet set up properly. Also, this usually happens "around the second half" of ITs, when cached and warmed up embedded instance is already uber optimized.

Backport of bb94de0

…che#11303)

When `--raw-streams` is used (especially when combined with options like `--quiet` and `-DforceStdout`) there is no guarantee that anything touches terminal. Hence, in case of embedded executor it is quite possible that cached/warm code arrives quickly at the place that would do system out **before** the thread with `FastTerminal` finishes system install.

In other words, when `--raw-streams` are used, we cannot guarantee that system streams are already properly set up. This PR changes that, and makes sure (by triggering a dummy call to terminal), at the cost of "jline3 install lag" for CLI invocation. OTOH, this lag in case of embedded executors does not exists (it exists only on first invocation).

My suspicion that this is the cause of IT instability issues, when Verifier used Toolbox output ends up on Surefire stdout and not on "grabbed" output, as simply streams are not yet set up properly. Also, this usually happens "around the second half" of ITs, when cached and warmed up embedded instance is already uber optimized.
@cstamas cstamas self-assigned this Oct 21, 2025
@cstamas cstamas added bug Something isn't working backport labels Oct 21, 2025
@cstamas cstamas added this to the 4.0.0 milestone Oct 21, 2025
@cstamas cstamas marked this pull request as ready for review October 21, 2025 12:19
@cstamas cstamas merged commit 5f24cba into apache:maven-4.0.x Oct 21, 2025
18 of 19 checks passed
@cstamas cstamas deleted the maven-4.0.x-raw-streams-bug branch October 21, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant