-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Comments
Steps to reproduce using StartStopTS
- new String[]{"mvn", "clean", "quarkus:dev", "-Dmaven.repo.local=" + getLocalMavenRepoDir()}
+ new String[]{"mvn", "-e", "clean", "quarkus:dev", "-Dmaven.repo.local=" + getLocalMavenRepoDir()}
Example fail: https://github.com/quarkus-qe/quarkus-startstop/pull/53/checks?check_run_id=1775459864 |
FTR, back in October I also realized that Quarkus dev mode is not exiting gracefully on Windows: #12577 (comment) |
This is the full stacktrace I got from StartStopTS execution on Windows as mentioned in my above comment
|
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.
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.
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.
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.
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.
With 2.0.0.CR3 running in WSL I see the following behaviour: |
Which version of Quarkus? Is there any chance you could run Basically does this code detect WSL as being Windows or Linux? |
@stuartwdouglas I don't know how to debug into the application when started in WSL. However, created a simple Java-Main class that just calls It detects the OS as "Linux". |
Also tested with With Continous Testing enabled: Pressing Then the application stops with some warnings:
With Continous Testing disabled: Pressing CTRL+c once works. Application stopps with warnings:
|
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 |
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 |
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. |
I'm having the exact same problem. Disabling dev-services did not fix the problem. |
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 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. |
I can confirm that the same issue is occurring for me. When I run Has any progress toward fixing the cause if the problem been made? |
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. |
Is this still an issue? |
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
|
This is also still an issue for us on Windows with Quarkus 3.15.1, ShutdownHooks and ShutdownEvents are not triggered in dev mode |
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 ? |
That could be the case, but I don't have a Windows machine to check it out unfortunately |
Describe the bug
In order to reproduce the issue:
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):
java -version
: 11The text was updated successfully, but these errors were encountered: