Skip to content
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

Register processes to be killed when extension is unloaded #3331

Closed
2 tasks
DonJayamanne opened this issue Nov 13, 2018 · 4 comments
Closed
2 tasks

Register processes to be killed when extension is unloaded #3331

DonJayamanne opened this issue Nov 13, 2018 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debt Covers everything internal: CI, testing, refactoring of the codebase, etc.

Comments

@DonJayamanne
Copy link

DonJayamanne commented Nov 13, 2018

Processes spawned need to be killed in the dispose handler.
I.e. when extension is unloaded/deactivated we need to shutdown all processes started by the extension.

  • Kill debugger processes spawned
  • Kill linter, formatter, jedi processes spawned
@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug needs PR debt Covers everything internal: CI, testing, refactoring of the codebase, etc. labels Nov 13, 2018
@koliyo
Copy link

koliyo commented Jan 31, 2019

I experienced the same problem in #4221

After reloading the window the processes are no longer in the VS Code Process Explorer, but they are still running on the OS until I kill them of manually.

Mac OS Mojave

@koliyo
Copy link

koliyo commented Jan 31, 2019

Note, if you start child processes with posix pgid attributes you can kill of child processes automatically when killing the parent process.

Here is some go-code I am using:

// NOTE: This code does not work for windows, therefore separate compile units

// StartProcess _
func StartProcess(cmd *exec.Cmd) error {
	cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
	return cmd.Start()
}

// KillProcess _
func KillProcess(cmd *exec.Cmd) error {
	// job.Cmd.Process.Kill()
	return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
}

This approach is taken from https://medium.com/@felixge/killing-a-child-process-and-all-of-its-children-in-go-54079af94773

@DonJayamanne
Copy link
Author

Solution:

@DonJayamanne
Copy link
Author

This needs to be completed before the Azdo Timeouts are addressed.

@ghost ghost removed the needs PR label Mar 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debt Covers everything internal: CI, testing, refactoring of the codebase, etc.
Projects
None yet
Development

No branches or pull requests

3 participants