microsoft / microsoft/vscode-python-debugger

Add configuration option to issue a SIGTERM when the Stop button is clicked in debugger

Abierto
#316 10 comentarios 60 reacciones 1 asignado Ver en GitHub

@karthiknadig ya está trabajando en esto.

Desde el 8/8/2024.

feature-request needs community feedback
Lenguaje dominante
TypeScript
Estrellas
181
Forks
126
Merge medio
2 d 3 h
PR fusionados (30 d)
3

Descripción

I want the ability to use the "Stop" button in the Python debugger in VS Code to send a SIGTERM (and/or maybe a SIGINT) to the running process, instead of just sending it SIGKILL (as it currently does).

This is the "Stop" button I'm talking about:
image

Proposed Solution

I'm thinking that a new option like this in the launch.json config file could be a good way to introduce this change without being a breaking change for the way everyone is used to the "stop" button working.

{
  "configurations": [
    {
      "name": "Python Debugger: Current File (Integrated Terminal)",
      "type": "debugpy",
      "request": "launch",
      "program": "${file}",
      "console": "integratedTerminal",
      "stop_action": "SIGKILL", // this would be a new enum-like config option, with values of "SIGKILL", "SIGINT", "SIGTERM", maybe others
    },
  ]
}
Possible additional ideas, more context
  • The minimum viable solution is described above.

  • SIGKILL (the current behavior) and SIGTERM are the two behaviors I'm personally chasing. SIGINT is another one that would be good to have as an option though.

  • As an extended implementation, the stop_action field could support a process like: send SIGTERM, wait 15 seconds, send SIGKILL.

  • This feature request stems from wanting to be able to test and debug the AWS Batch end-of-job behavior:

Under the hood, the Amazon ECS StopTask API call is used, which sends a SIGTERM value to the running container task. If after 30 seconds the container is still running, a SIGKILL signal is sent to forcibly stop the container. If the container handles the SIGTERM value gracefully and exits within 30 seconds from receiving it, no SIGKILL value is sent.

Related Previous Issues and Discussions

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.