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

Quarkus is not gratefully being shutdown in Windows when running in DEV mode #14647

Open
Sgitario opened this issue Jan 27, 2021 · 20 comments
Open
Labels
area/devmode env/windows Impacts Windows machines kind/bug Something isn't working

Comments

@Sgitario
Copy link
Contributor

Describe the bug
In order to reproduce the issue:

  1. Generate the Maven project using the instructions in this guide: https://quarkus.io/guides/getting-started#bootstrapping-the-project
mvn io.quarkus:quarkus-maven-plugin:1.11.0.Final:create -DprojectGroupId=org.acme -DprojectArtifactId=getting-started -DclassName="org.acme.getting.started.GreetingResource" -Dpath="/hello"
  1. Run the project using DEV mode:
mvn clean compile quarkus:dev
  1. Exit the application using CTRL + c, and then maven would say that the build failed:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  26.859 s
[INFO] Finished at: 2021-01-27T08:59:14Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.11.0.Final:dev (default-cli) on project app-generated-skeleton: Failed to run: Dev mode process did not complete successfully -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.quarkus:quarkus-maven-plugin:1.11.0.Final:dev (default-cli) on project app-generated-skeleton: Failed to run
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoFailureException: Failed to run

It seems that the shutdown hook is not being triggered when doing the above steps. Then, the process detects that is not alive any longer and the exit status returns 1 (error).

Note that Java is behaving differently in Linux and Windows in regards to shutdown hooks: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4485742

Expected behavior
The expected behavior would be the same as running the steps in Linux.

Environment (please complete the following information):

  • OS version: Windows 10
  • Output of java -version: 11
  • Quarkus version or git rev: 1.11.0.Final
@Sgitario Sgitario added the kind/bug Something isn't working label Jan 27, 2021
@ghost ghost added area/devmode env/windows Impacts Windows machines labels Jan 27, 2021
@Sgitario
Copy link
Contributor Author

^^ @stuartwdouglas

@rsvoboda
Copy link
Member

Steps to reproduce using StartStopTS

  • git clone https://github.com/quarkus-qe/quarkus-startstop
  • adjust testsuite/src/it/java/io/quarkus/ts/startstop/utils/MvnCmds.java
-            new String[]{"mvn", "clean", "quarkus:dev", "-Dmaven.repo.local=" + getLocalMavenRepoDir()}
+            new String[]{"mvn", "-e", "clean", "quarkus:dev", "-Dmaven.repo.local=" + getLocalMavenRepoDir()}
  • run mvn clean verify -Ptestsuite -Dtest=ArtifactGeneratorTest
    • append -Dquarkus.version=999-SNAPSHOT if you want to run against Quarkus master
  • open testsuite/target/archived-logs/io.quarkus.ts.startstop.ArtifactGeneratorTest/manyExtensionsSetB/warmup-dev-run.log
  • see the stacktrace is at the end

Example fail: https://github.com/quarkus-qe/quarkus-startstop/pull/53/checks?check_run_id=1775459864

@famod
Copy link
Member

famod commented Jan 27, 2021

FTR, back in October I also realized that Quarkus dev mode is not exiting gracefully on Windows: #12577 (comment)
But I have never seen such a stacktrace...

@rsvoboda
Copy link
Member

This is the full stacktrace I got from StartStopTS execution on Windows as mentioned in my above comment

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.11.0.Final:dev (default-cli) on project app-generated-skeleton: Failed to run: Dev mode process did not complete successfully -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.quarkus:quarkus-maven-plugin:1.11.0.Final:dev (default-cli) on project app-generated-skeleton: Failed to run
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoFailureException: Failed to run
    at io.quarkus.maven.DevMojo.execute (DevMojo.java:356)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Dev mode process did not complete successfully
    at io.quarkus.maven.DevMojo.execute (DevMojo.java:325)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 

Sgitario added a commit to Sgitario/quarkus-startstop that referenced this issue Apr 28, 2021
Changes:
- Windows fails to stop an application when running on DEV mode. Reported issue: quarkusio/quarkus#14647
- Windows disallows to delete folders when they are being used by the file explorer or the processes are about to be exited. This is why:
1. I'm ignoring these errors when the directory can't be deleted (it's not Quarkus issue)
2. I splitted the "s p a c e s" runs into there different folders for jvm, native and dev mode.
Sgitario added a commit to Sgitario/quarkus-startstop that referenced this issue Apr 28, 2021
Changes:
- Windows fails to stop an application when running on DEV mode. Reported issue: quarkusio/quarkus#14647
- Windows disallows to delete folders when they are being used by the file explorer or the processes are about to be exited. This is why:
1. I'm ignoring these errors when the directory can't be deleted (it's not Quarkus issue)
2. I splitted the "s p a c e s" runs into there different folders for jvm, native and dev mode.
Sgitario added a commit to Sgitario/quarkus-startstop that referenced this issue Apr 29, 2021
Changes:
- Windows fails to stop an application when running on DEV mode. Reported issue: quarkusio/quarkus#14647
- Windows disallows to delete folders when they are being used by the file explorer or the processes are about to be exited. This is why:
1. I'm ignoring these errors when the directory can't be deleted (it's not Quarkus issue)
2. I splitted the "s p a c e s" runs into there different folders for jvm, native and dev mode.
Sgitario added a commit to Sgitario/quarkus-startstop that referenced this issue Apr 29, 2021
Changes:
- Windows fails to stop an application when running on DEV mode. Reported issue: quarkusio/quarkus#14647
- Windows disallows to delete folders when they are being used by the file explorer or the processes are about to be exited. This is why:
1. I'm ignoring these errors when the directory can't be deleted (it's not Quarkus issue)
2. I splitted the "s p a c e s" runs into there different folders for jvm, native and dev mode.
rsvoboda pushed a commit to quarkus-qe/quarkus-startstop that referenced this issue Apr 29, 2021
Changes:
- Windows fails to stop an application when running on DEV mode. Reported issue: quarkusio/quarkus#14647
- Windows disallows to delete folders when they are being used by the file explorer or the processes are about to be exited. This is why:
1. I'm ignoring these errors when the directory can't be deleted (it's not Quarkus issue)
2. I splitted the "s p a c e s" runs into there different folders for jvm, native and dev mode.
@ghost
Copy link

ghost commented Jun 24, 2021

@stuartwdouglas

With 2.0.0.CR3 running in WSL I see the following behaviour:
Pressing CTRL+c in Dev Mode does not exit the application when Continuous Testing is enabled.
When Continuous Testing is disabled, the application stops as expected (without an exception).

@stuartwdouglas
Copy link
Member

Which version of Quarkus? Is there any chance you could run mvnDebug quarkus:dev and see what happens in this bit of code: https://github.com/stuartwdouglas/quarkus/blob/96a1a527dc89872c599bc0f122b98e65f9aea6d8/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java#L404

Basically does this code detect WSL as being Windows or Linux?

@ghost
Copy link

ghost commented Jun 28, 2021

@stuartwdouglas
Quarkus 2.0.0.CR3
Using WSL 1 (not 2)

I don't know how to debug into the application when started in WSL. However, created a simple Java-Main class that just calls OS.determineOS() and prints the output.

It detects the OS as "Linux".

@ghost
Copy link

ghost commented Jun 28, 2021

Also tested with cmd.exe:

With Continous Testing enabled:

Pressing CTRL+c only once is not enough. It has to be pressed two times.

Then the application stops with some warnings:

2021-06-28 09:20:12,051 INFO  [io.quarkus] (Quarkus Main Thread) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.0.0.CR3) started in 3.405s. Listening on: http://localhost:8080
2021-06-28 09:20:12,074 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2021-06-28 09:20:12,082 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy, smallrye-context-propagation]

--
Tests paused, press [r] to resumeJuni 28, 2021 9:20:37 AM org.aesh.readline.terminal.impl.AbstractWindowsTerminal$ConsoleOutput accept
WARNUNG: Failed to write out.
Juni 28, 2021 9:20:37 AM org.aesh.readline.terminal.impl.AbstractWindowsTerminal$ConsoleOutput accept
WARNUNG: Failed to write out.
Juni 28, 2021 9:20:37 AM org.aesh.readline.terminal.impl.AbstractWindowsTerminal$ConsoleOutput accept
WARNUNG: Failed to write out.
Juni 28, 2021 9:20:37 AM org.aesh.readline.terminal.impl.AbstractWindowsTerminal$ConsoleOutput accept
WARNUNG: Failed to write out.

With Continous Testing disabled:

Pressing CTRL+c once works. Application stopps with warnings:

2021-06-28 09:22:55,400 INFO  [io.quarkus] (Quarkus Main Thread) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.0.0.CR3) started in 3.410s. Listening on: http://localhost:8080
2021-06-28 09:22:55,415 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2021-06-28 09:22:55,423 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy, smallrye-context-propagation]
2021-06-28 09:23:04,528 INFO  [io.quarkus] (Shutdown thread) code-with-quarkus stopped in 0.027s
Juni 28, 2021 9:23:04 AM org.aesh.readline.terminal.impl.AbstractWindowsTerminal$ConsoleOutput accept
WARNUNG: Failed to write out.
Juni 28, 2021 9:23:05 AM org.aesh.readline.terminal.impl.AbstractWindowsTerminal$ConsoleOutput accept
WARNUNG: Failed to write out.
Juni 28, 2021 9:23:05 AM org.aesh.readline.terminal.impl.AbstractWindowsTerminal$ConsoleOutput accept
WARNUNG: Failed to write out.
Juni 28, 2021 9:23:05 AM org.aesh.readline.terminal.impl.AbstractWindowsTerminal$ConsoleOutput accept
WARNUNG: Failed to write out.
Batchvorgang abbrechen (J/N)?

@Eat-Sleep-HitBean
Copy link

Can someone tell me how to recover or ignore the problem, even restarting the computer won't solve the problem,i can not study follow the quarkus guide

@Eat-Sleep-HitBean
Copy link

Eat-Sleep-HitBean commented Nov 23, 2021

for more information,my IDEA run quarkus:dev successfully at first,when i install Docker Desktop on Windows and restart the computer,my IDEA can not run with quarkus:dev,when i uninstall the Docker Desktop and restart computer, my IDEA run with quarkus:dev successfully again,i do not know why, but i hope my experience could help other people

@stuartwdouglas
Copy link
Member

Are you using an extension that is attempting to start a dev service (https://quarkus.io/guides/dev-services)? If so docker might just be really slowly trying to start a container. There should be some log output though.

quarkus.devservices.enabled=false should disable this.

@ahmedalnuaimi
Copy link

ahmedalnuaimi commented May 25, 2022

I'm having the exact same problem. Disabling dev-services did not fix the problem.

@alexkolson
Copy link

alexkolson commented Mar 20, 2023

Still witnessing this issue in 2.16.3 in windows. Any tips or updates?

This behavior manifests itself both from inside IntelliJ and from pressing "Ctrl-C" in a windows terminal console where quarkus:dev is running. It does not, however, happen every time.

It seems that, at least for me, if I switch from Windows Terminal to Powershell, sending a "Ctrl+C" somewhat reliably causes quarkus dev mode to shutdown gracefully. However, when runnung from IntelliJ, even if I use the IntelliJ "exit" option then I get a "Dev mode process did not complete successfully". Do I somehow need to get intellij to wait for the shutdown hooks to run?

I'm not really sure this is quarkus' problem per se, but reaching out here as perhaps somebody has some tips on how I can get IntelliJ to stop quarkus dev mode correctly.

@NZnick
Copy link

NZnick commented May 11, 2023

I can confirm that the same issue is occurring for me. When I run mvn compile quarkus:dev from inside Git Bash and then send Ctrl+C maven reports a BUILD FAILURE and code in my shutdown handler which @Observes ShutdownEvent never runs. However, as mentioned by @alexkolson when I try the same thing in PowerShell maven reports a BUILD SUCCESS and my shutdown handler runs. I'm running Quarkus 2.16.6.Final.

Has any progress toward fixing the cause if the problem been made?

@cuichenli
Copy link
Contributor

I have encountered the exact same behavior on macOS, both when using the terminal and IntelliJ. I have included the @observes ShutdownEvent annotation, but it does not seem to trigger the desired invocation. My development environment is Quarkus version 3.2.3.Final.

@geoand
Copy link
Contributor

geoand commented Sep 20, 2024

Is this still an issue?

@geoand geoand added the triage/needs-feedback We are waiting for feedback. label Sep 20, 2024
@thibaultmeyer
Copy link
Contributor

thibaultmeyer commented Oct 1, 2024

Same issue here, shutdown (and graceful shutdown) work very well in dev mode (MacOS via IntelliJ). But, dont work (juste a crash) on Windows (via IntelliJ too).

Quarkus 3.15.1
IntelliJ 2024.2.3 (Ultimate)

[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.15.1:dev (default-cli) on project quarkus-demo: Failed to run: Dev mode process did not complete successfully -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.15.1:dev (default-cli) on project quarkus-demo: Failed to run
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    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:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoFailureException: Failed to run
    at io.quarkus.maven.DevMojo.execute (DevMojo.java:500)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    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:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: Dev mode process did not complete successfully
    at io.quarkus.maven.DevMojo.execute (DevMojo.java:467)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    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:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[DEBUG] Shutting down adapter factory; available factories [file-lock, rwlock-local, semaphore-local, noop]; available name mappers [discriminating, file-gav, file-hgav, file-static, gav, static]
[DEBUG] Shutting down 'file-lock' factory
[DEBUG] Shutting down 'rwlock-local' factory
[DEBUG] Shutting down 'semaphore-local' factory
[DEBUG] Shutting down 'noop' factory

@ls-bit
Copy link

ls-bit commented Oct 17, 2024

This is also still an issue for us on Windows with Quarkus 3.15.1, ShutdownHooks and ShutdownEvents are not triggered in dev mode

@geoand geoand removed the triage/needs-feedback We are waiting for feedback. label Oct 17, 2024
@thibaultmeyer
Copy link
Contributor

thibaultmeyer commented Oct 27, 2024

If it might help, instead of just "stopping" Maven with Ctrl-C, I try using the "q" command in the interactive Quarkus shell. Graceful shutdown works fine and no error occurs. Maybe missing something on Ctrl-C signal handling to simulate the "q" command ?

@geoand

@geoand
Copy link
Contributor

geoand commented Oct 30, 2024

That could be the case, but I don't have a Windows machine to check it out unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests