When stopping a debugging session, the application will be killed immediately without running shutdownHook code. There is the same discussion in the GO Lang project (golang/vscode-go#120).
It would be nice to have the chance to decide, how the application will be killed (SIGKILL vs SIGTERM). Both are valid use-cases. Maybe it's even possible to have options on the STOP button of the debug panel. As we have multi-project workspaces, it really depends on the application (even situation) what you need.
Environment
- Operating System: MacOS (But same on Windows/Linux)
- JDK version: 11
- Visual Studio Code version: 1.74.0
- Java extension version: v0.25.7
- Java Debugger extension version: v0.47.0
Steps To Reproduce
- Made a java application with an
shutdownHook (Runtime.addShutdownHook)
- Start the application
- Stop the application by clicking the STOP button in the debug panel.
Current Result
The shutdownHook will not be executed.
Expected Result
The shutdownHook will be executed. (At least if the user chooses to)
Additional Informations
N/A
When stopping a debugging session, the application will be killed immediately without running
shutdownHookcode. There is the same discussion in the GO Lang project (golang/vscode-go#120).It would be nice to have the chance to decide, how the application will be killed (
SIGKILLvsSIGTERM). Both are valid use-cases. Maybe it's even possible to have options on the STOP button of the debug panel. As we have multi-project workspaces, it really depends on the application (even situation) what you need.Environment
Steps To Reproduce
shutdownHook(Runtime.addShutdownHook)Current Result
The
shutdownHookwill not be executed.Expected Result
The
shutdownHookwill be executed. (At least if the user chooses to)Additional Informations
N/A