Open mbien opened 1 month ago
i will likely open some cleanup PRs first, since I updated a few things while debugging this.
in principle, this could be fixed via a small change within mvnd and would also align with what the client already does on SIGINT (ctrl+c). (it sends a cancel message to the connected daemon which cancels the build and makes itself available again for other tasks)
here is a prototype which:
--install-exit-handlers
, since without it, GraalVM would not trigger shutdown hooks on irregular shutdownsThe problem however is that the build is also setting -H:-ParseRuntimeOptions
for the purpose of delegating -D
params instead of parsing them as args. This seems to mess with the signal chaining and prevents the shutdown hook from running again.
This may or may not be a graalvm bug - needs more investigation
(there are other options how to implement this, e.g the daemon could cancel builds once the client connection is gone - it all depends on the requirements)
Apache NetBeans version
Apache NetBeans 22
What happened
There is some support for mvnd since NB 13 (https://github.com/apache/netbeans/pull/3210) and generally works ok for common build tasks.
However, the stop button can cause problems under some circumstances. It terminates the process tree, the JVM may not be in the tree of the mvnd process though (unless it runs for the first time and is not a reused daemon yet). Pressing stop will kill the mvnd process (which is sometimes just the client), but the "build" will continue running in the daemon.
what works:
what doesn't work / reproducer: 1) press build and wait till it finishes (there is now a daemon available) 2) press run (program runs as child of the daemon, the mvnd client process won't have any children) 3) press stop (this will kill the mvnd client process only, rest will continue running)
workaround: run
mvnd --stop
before starting tasks where you expect to press stop, or clean up the processes periodicallyLanguage / Project Type / NetBeans Component
java maven project
How to reproduce
see above
Did this work correctly in an earlier version?
No / Don't know
Operating System
linux
JDK
22.0.2, Temurin
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
Yes (likely upstream)