I notice that when using the Bndrun task with gradle, if I hit ctrl+c, or cancel from IntelliJ, the task exits immediately, but the container continues to run. I.e. the webconsole is still running, all of my services are still running.
I’d like to be able to quit the process from gradle or from the IDE.
I think this is somewhat related to #5249 on gradle github, and I believe the JavaExec task handles cancellation now via DefaultExecActionFactory
If I register a shutdown hook, I can see the logs if I kill the process via pkill, but not if I ctrl+C on the gradle task, which leads me to believe the way it is launched prevents the kill signal reaching the container?
Is it intended that one can kill the container process via cancelling the gradle task?
My testing project is currently at danelowe/osgi-runway on github
Yeah it seems that --no-daemon allows the container to be killed, but doesn’t run the shutdown hook. I had thought that recent versions of gradle still used a ‘single-use’ daemon for --no-daemon, but it seems it has slightly different behaviour.
I do think there is probably something that can be done for use with a daemon, but might need some work in the ProjectLauncher, which I am yet to understand.
Gradle’s JavaExec task seems to use a cancellation token of some sort to deal with this.
I do know that Quarkus dev task works with gradle daemon and shuts down completely. I also note that the Bndrun task continually shows a progress meter while the container is running, which e.q. Quarkus does not show after the build is completed.