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

Fix process cancelation #3131

Merged
merged 3 commits into from
Mar 28, 2020
Merged

Fix process cancelation #3131

merged 3 commits into from
Mar 28, 2020

Conversation

zmb3
Copy link
Contributor

@zmb3 zmb3 commented Mar 27, 2020

Processes were not being killed due to the path to the external scripts being incorrect. Fix this by relying on the tree-kill package rather than shelling out to an external script to kill a process and its children.

Also add sinon as a dev dependency for testing purposes.

Updates #3044

Processes were not being killed due to the path to the external scripts
being incorrect.  Fix this by relying on the tree-kill package rather
than shelling out to an external script to kill a process and its
children.

Also add sinon as a dev dependency for testing purposes.

Updates #3044
@quoctruong
Copy link
Contributor

quoctruong commented Mar 27, 2020

That sounds good. Feel free to close this pr.

@@ -36,6 +36,7 @@ import {
getInferredGopath,
parseEnvFile
} from '../goPath';
import { killTree } from '../util';
Copy link
Contributor

Choose a reason for hiding this comment

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

We cannot have the debug adapter take a dependency on util which depends on the vscode module. This is because the debug adapter is run in a process different from the rest of the extension. The process in which the rest of the extension runs has access to vscode, but the process running the debug adapter doesnt. That's why previously, the kill code is copied here in this file instead of re-using from util

Copy link
Contributor

Choose a reason for hiding this comment

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

We can however move the killTree out of the util into a separate file and then re-use it from there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, got it.

zmb3 and others added 2 commits March 27, 2020 07:43
We cannot take a dependency on util, which depends on the vscode module
because the debug adapter runs in a process that doesn't have access
to the vscode module.
Copy link
Contributor

@ramya-rao-a ramya-rao-a left a comment

Choose a reason for hiding this comment

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

Thanks Zac!

@ramya-rao-a ramya-rao-a merged commit e4814d0 into microsoft:master Mar 28, 2020
@zmb3 zmb3 deleted the zb-kill-procs branch March 28, 2020 23:49
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