The only definition of "graceful" I can think of is the program executing its own shut-down logic, concluding it a call to System.exit(). I can't see a way to endow the debugger with the ability to magically be able to trigger that processing.
AFAIK there's no reliable way in Java to send SIGINT termination signal to other process, so IDEA invokes Process.destroy() for an "ungraceful" shutdown. I may imagine that particular application can read input stream and handle a certain sequence as a 'shutdown' command, but it won't work in general case.
SIGTERM would be the conventional "polite" way to terminate a process from without. SIGKILL is the "insistent" way.
Additionally, many interactive applications don't even quit when they receive a SIGINT (conventionally generated by the terminal driver), but rather go back to some sort of top-level prompt, stop a long-running computation, or perforam a similar non-termination activity.
Hello Ashwin,
What do you mean under "gracefully"?
Regards,
Kirill
The red stop button just terminates the JVM in Debug mode. In Run mode, you can also send a Ctrl-C signal to shutdown the program, correct?
The only definition of "graceful" I can think of is the program executing its own shut-down logic, concluding it a call to System.exit(). I can't see a way to endow the debugger with the ability to magically be able to trigger that processing.
Randall Schulz
Hello Ashwin,
AFAIK there's no reliable way in Java to send SIGINT termination signal to other process, so IDEA invokes Process.destroy() for an "ungraceful" shutdown. I may imagine that particular application can read input stream and handle a certain sequence as a 'shutdown' command, but it won't work in general case.
Regards,
Kirill
SIGTERM would be the conventional "polite" way to terminate a process from without. SIGKILL is the "insistent" way.
Additionally, many interactive applications don't even quit when they receive a SIGINT (conventionally generated by the terminal driver), but rather go back to some sort of top-level prompt, stop a long-running computation, or perforam a similar non-termination activity.
Randall Schulz
Are there updates here?
@Pavel could you please describe your issue? What run configuration do you use?
Actually, I do not modify the default preset:
Such a code works well and allows me to handle shutdown gracefully but not in a debug session.
Pavel Prischepa You can follow the update of the GO-8084 task. I recommend to go and vote to stay informed.