Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages Interleaving for spawned processes on parallel builds does not seem to be working #5

Open
eliasbalasis opened this issue May 18, 2021 · 10 comments

Comments

@eliasbalasis
Copy link

eliasbalasis commented May 18, 2021

With parallel builds enabled (e.g. mvn clean verify -B -Dmaven.logging=byproject -T 1C) and all required Maven extensions installed,

the log messages of integration tests being run by maven-failsafe-plugin interleave with log messages from other projects.

I suspect the reason is JVM forking which is required by maven-failsafe-plugin for parallel builds (forkCount>0.

Is my suspicion correct?
If yes, how could this be fixed?

@eliasbalasis
Copy link
Author

Any news on this?

@eliasbalasis
Copy link
Author

I am afraid, we cannot make proper use of parallel builds if the logs are overlapping.

Can the logger be fixed please?

Is there anything we could do to help?

@jvanzyl
Copy link

jvanzyl commented May 18, 2022

We might be able to take a look at the Maven Daemon has done. But for the console what do you think should happen? Wait until the end to emit the individual logs?

@eliasbalasis
Copy link
Author

Certainly not until the very end.
Perhaps emit at end of each individual artifact's build.

Nevertheless, the logs have to be displayed in execution order, as stated in the project page:
The downside of this configuration, build may appear "stuck" due to message buffering

The wait is a necessary evil I am afraid, to guarantee display order, but it hasn't worked.
Project messages always interleave with messages from other projects or overall build log messages.

@jvanzyl
Copy link

jvanzyl commented May 18, 2022

Surefire and Failsafe use a bunch of non-SLF4J logging mechanisms so my suspicion is that's why nothing from that plugin works. I'll ask the Maven Daemon folks what they did to capture output.

@eliasbalasis
Copy link
Author

eliasbalasis commented May 18, 2022

I am thinking that JCL and JUL components of SLF4J, which are present in my ${MAVEN_HOME}/lib/ext, should be able to capture messages from other logging mechanisms.

Also, I am afraid this may not be relevant only to "surefire" and "failsafe" plugins, I am seeing console messages from "compile" phase interleaving, but coming from "maven-gwt-plugin" on one occasion, I suspect this plugin is also using non-SLF4J mechanisms and there could be other plugins doing the same.

I am wondering, would adding "artifactId" and "thread name" to "byproject" logger (as in "ci" logger) help as a temporary workaround?

@eliasbalasis
Copy link
Author

@jvanzyl , have you discovered anything reaching out to Maven Daemon folks?

@eliasbalasis
Copy link
Author

eliasbalasis commented Jun 9, 2022

I am starting to get the feeling that, as initially stated, the problem lies with JVM forking which is required by maven-failsafe-plugin for parallel builds (forkCount>0)

parallel maven execution is not compatible with surefire forkCount 0

The concurrent logger orders messages from MDC of primary Maven JVM but probably cannot order messages from MDC of forked JVMs because it is simply inaccessible.

Is my suspicion correct?

@eliasbalasis
Copy link
Author

eliasbalasis commented Jul 8, 2022

@jvanzyl , any news on this? Do you think my suspicion is correct? if yes what can we do about this?

@eliasbalasis eliasbalasis changed the title Log Messages Interleaving for Integration Tests Messages Interleaving for spawned processes on parallel builds does not seem to be working Apr 23, 2024
@eliasbalasis
Copy link
Author

@jvanzyl what are your thoughts on this?
message ordering is not honored for spawned processes on parallel builds with 2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants