Skip to content

Debug: Provide graceful shutdown on debug stop action #1274

@circlesmiler

Description

@circlesmiler

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
  1. Made a java application with an shutdownHook (Runtime.addShutdownHook)
  2. Start the application
  3. 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

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions