vscode-csharp: Leaking razor process
The csharp extension is leaking processes.
501 2957 1 0 8:22AM ?? 0:01.65 /Users/nils/.vscode/extensions/ms-vscode.csharp-1.17.1/.razor/rzls -lsp --logLevel None
Note: VS code is not running
Environment data
dotnet --info
output: Version: 2.2.103
VS Code version: 1.31.1
C# Extension version: 1.17.1
Mac OS Mojave
Steps to reproduce
Expected behavior
Proper cleanup of internal processes
Actual behavior
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 23 (5 by maintainers)
This is a big issue. See the screenshot below - there are over a dozen of these abandoned
rzls
processes running - even for older versions of the extension. This is with the latest version of the C# extension, and latest Insider version of VS Code (as of today):Also faced this today randomly. I’m not even trying to use Razor or C#!
The short term report is rzls orphaned processes seems fixed on macOS. Thank you 🙏 . Saves me having to manually kill the processes which was a real pain.
@NTaylorMullen We include it in our list of things to dispose when the extension is deactivated: https://github.com/OmniSharp/omnisharp-vscode/blob/master/src/omnisharp/extension.ts#L171
For server’s written in node this is addressed by passing the process id of the extension host to the server. Here we do this generically since we know how to start node. The Razor server uses a command to start the server. You could do the same and simply add an argument to the command that passes the process id. Our servers then check from time to time of that process still exists and if not exit themselves. This works under Linux, Mac and Windows.