Using quarkusDev with gradle leaves process running
See original GitHub issueDescribe the bug
When running quarkus in dev mode, using ./gradlew quarkusDev
, the service is started correctly but when gradle is closed (by pressing Ctrl+C) the process is left running. Subsequent attempts to run in dev mode result in a port conflict for the debug port and an increasing number of processes left behind.
Expected behavior
When you terminate the gradle build then the associated process running the quarkus jar should also be killed.
Actual behavior
The java process running the quarkus jar is left running.
To Reproduce
When creating a new gradle project using the maven template this issue does not initially occur and when you stop the gradle build the java process is also stopped. However adding certain extensions such as io.quarkus:quarkus-micrometer-registry-prometheus
causes this problem to occur, as long as you have metrics enabled.
Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific). https://github.com/briancullen/quarkus-reproducer
Steps to reproduce the behavior:
- Clone the git repo
- Run
./gradlew quarkusDev
- Press Ctrl+C to stop the build process.
Environment (please complete the following information):
Output of uname -a
or ver
Linux xxxxx 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version “11.0.8” 2020-07-14 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10) Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.21.0, JRE 11 Linux amd64-64-Bit Compressed References 20200715_697 (JIT enabled, AOT enabled) OpenJ9 - 34cf4c075 OMR - 113e54219 JCL - 95bb504fbb based on jdk-11.0.8+10)
GraalVM version (if different from Java)
Quarkus version or git rev
1.13.0.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
Gradle 6.8.3
Build time: 2021-02-22 16:13:28 UTC Revision: 9e26b4a9ebb910eaa1b8da8ff8575e514bc61c78
Kotlin: 1.4.20 Groovy: 2.5.12 Ant: Apache Ant™ version 1.10.9 compiled on September 27 2020 JVM: 11.0.8 (Eclipse OpenJ9 openj9-0.21.0) OS: Linux 5.8.0-48-generic amd64
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (7 by maintainers)
This is no longer an issue in 1.13.1.Final. Thanks!
Looking at the code in
VertxRecorder
there’s a possibility for this to block forever. I’ve created a PR with a potential fix https://github.com/quarkusio/quarkus/pull/16253 (I don’t have an easy way to verify that it fixes your issue).