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

Exit code not propagated from the daemon to mvnd client #220

Closed
ppalaga opened this issue Nov 13, 2020 · 1 comment · Fixed by #222
Closed

Exit code not propagated from the daemon to mvnd client #220

ppalaga opened this issue Nov 13, 2020 · 1 comment · Fixed by #222
Assignees
Milestone

Comments

@ppalaga
Copy link
Contributor

ppalaga commented Nov 13, 2020

Calling cl.execute(output, "clean", "install", "-e", "-B").assertSuccess(); in NewManagedModuleNativeIT should be enough to make the test fail. But it is not. There is apparently some exception thrown in the daemon, but the deamon exception handlers are not catching it. It looks like the exception belongs to a different class loader then the exception handlers.

Here is the daemon exception stack trace:

	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:397)
	at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:414)
	at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:405)
	at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:82)
	at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:507)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.DaemonMavenCli.execute(DaemonMavenCli.java:651)
	at org.apache.maven.cli.DaemonMavenCli.doMain(DaemonMavenCli.java:193)
	at org.apache.maven.cli.DaemonMavenCli.main(DaemonMavenCli.java:175)
	at org.mvndaemon.mvnd.daemon.Server.handle(Server.java:532)
	at org.mvndaemon.mvnd.daemon.Server.client(Server.java:242)
	at org.mvndaemon.mvnd.daemon.Server.accept(Server.java:217)
	at java.base/java.lang.Thread.run(Thread.java:834)'}

Steps to reproduce are the same as in #218

@ppalaga
Copy link
Contributor Author

ppalaga commented Nov 15, 2020

No, the root cause is that we swallow the int result of org.apache.maven.cli.DaemonMavenCli.main(List<String>, String, String, Map<String, String>) which is the actual exit code. Let me fix it.

@ppalaga ppalaga self-assigned this Nov 15, 2020
@ppalaga ppalaga changed the title mvnd returns 0 exit code although there are "Problems encountered while processing the POMs" Exit code not propagated from the daemon to mvnd client Nov 15, 2020
@ppalaga ppalaga added this to the 0.0.13 milestone Nov 17, 2020
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

Successfully merging a pull request may close this issue.

1 participant