-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add configuration option to issue a SIGTERM when the Stop button is clicked in debugger #316
Comments
Thanks for the feature request! We are going to give the community 60 days to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue. |
Any intention to retake this? would be super useful to debug actions running on flask/fastapi app shutdown (i.e: closing db, connections, redis, etc) |
Hi just wanted to add some support for the proposal, same use case as @cdelacruzpinto on my end. |
I'm also interested in this as I need some hardware communication channels like pymodbus to be closed gracefully when stopping or restarting my program in debugging. The current behaviour of killing off any debugged program without calling destructors is just not suitable in many cases. Honestly I even think it should default to SIGTERM because its just expected behaviour that it shuts down programs gracefully but in case you dont want to change anything for other users @DeflateAwning s method of setting an option in launch.json wouldn't interfere with other users experience. |
To support this, we would need the underlying debugger to handle such a configuration. @rchiodo Do we have an issue for this on |
This issue makes me think this is more complicated than at first glance: But maybe it would work. There is not another issue that I can find though. |
Just opened this issue to track it: microsoft/debugpy#1818 |
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:
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.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:
Related Previous Issues and Discussions
The text was updated successfully, but these errors were encountered: