Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Support for terminate and terminateDebuggee. Fixes #1755 #1762

Merged

Conversation

fabioz
Copy link
Contributor

@fabioz fabioz commented Sep 11, 2019

No description provided.

if IS_WINDOWS:
self._terminate_process_and_children_windows()
else:
self._terminate_process_and_children_linux_and_mac()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion would be to make these handle the children only (conditional on the flag), and then wrap the call in a try..finally that does os._exit at the end. This way, if anything goes wrong while processing the subprocess tree, at least the process itself definitely exits.

The main reason is that the code that deals with children itself spawns another process and then communicates with it, and that can fail in so many ways - e.g. the helper process can spawn successfully but then crash.

@karthiknadig
Copy link
Member

This fixes #1715 as well.

@fabioz fabioz merged commit 63768ba into microsoft:dbg_adapter_refactor Sep 12, 2019
@fabioz fabioz deleted the rb_ptvsd_1755_terminate branch September 12, 2019 15:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants