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

"PowerShell Editor Services Host Process" orphans easily and chews up CPU when it is orphaned #102

Closed
AndrewGaspar opened this issue Jan 4, 2016 · 2 comments

Comments

@AndrewGaspar
Copy link

This is specifically in the context of using the editor services with VS Code.

At one point, the process would occasionally spin to and stay at 100% CPU usage just while doing tab completion (and tab completion would become unresponsive), but I believe that was fixed at some point via an update to the extension. That issue was also easy to resolve because you could just restart Code and the process would be restarted with it.

In this specific case I just ran into, the processes remain after closing all instances of VS Code. You have to taskkill them all manually. It's hard to pinpoint when exactly these specific orphaned instances were created, but I believe it was related to several crashed debug sessions (that's for a separate bug report, but I have yet to find an easy, contained repro).

I don't necessarily have a specific resolution to this bug in mind, I just wish that when some sort of issue occurs with the editor services host and/or the debug client, it would use something less than 100% CPU and, even more ideally, would kill the process. It might be that the easiest solution here is to just fix the bugs that causes the host to become runaway.

image

@daviwil
Copy link
Contributor

daviwil commented Jan 4, 2016

Yep, this is an issue with not handling the loss of the stdio streams after the parent process closes them. I need to fix this generally but hadn't gotten back around to it yet. Keith has already identified the source of the problem and filed a bug for it here:

#31

I'll try to get that one fixed for the next release so that it goes away for good :) I'll close your issue for now since the other one is already tracking it.

Thanks!

@daviwil daviwil closed this as completed Jan 4, 2016
@daviwil
Copy link
Contributor

daviwil commented Jan 4, 2016

By the way, your assumption about it being related to the debug adapter is correct. When debugging, VS Code spins up a new instance of the host process for each launch. These orphaned processes are likely due to a failure in the debugger that doesn't cause the process to crash but causes the VS Code debugger client to disconnect from it. That would cause the process to be orphaned and then lose its stdio stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants