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

Omnisharp does not terminate it's existing process when it is restarted. #1445

Closed
bakakaba opened this issue May 2, 2017 · 3 comments
Closed
Assignees
Milestone

Comments

@bakakaba
Copy link
Contributor

bakakaba commented May 2, 2017

Environment data

dotnet --info output:
.NET Command Line Tools (1.0.1)

Product Information:
Version: 1.0.1
Commit SHA-1 hash: 005db40cd1

Runtime Environment:
OS Name: fedora
OS Version: 25
OS Platform: Linux
RID: fedora.24-x64
Base Path: /opt/dotnet/sdk/1.0.1

VS Code version: 1.11.2
C# Extension version: 1.9.0

Steps to reproduce

  1. Open a C# project and let omnisharp do its thing.
  2. Select restart omnisharp from the command palette.

Expected behavior

The old omnisharp process is terminated and a new one is created.

Actual behavior

The old omnisharp process remains and a new one is created.
This causes multiple omnisharp process for the same window and chews up memory.
pasted image at 2017_05_02 11_39 am

@bakakaba
Copy link
Contributor Author

bakakaba commented May 2, 2017

@bakakaba
Copy link
Contributor Author

bakakaba commented May 9, 2017

Looks like the issue for this is that the Omnisharp process is a child process in a bash shell of which vscode has the reference to as the server process.

code
    code (extension host)
        bash <- vscode has this as the extension process and this is sent the SIGTERM when omnisharp is reloaded
            mono (omnisharp)

The omnisharp process becomes orphaned but doesn't get cleaned up until vscode exits (https://nodejs.org/api/child_process.html#child_process_child_kill_signal).

My proposal is to use https://www.npmjs.com/package/ps-tree and fire the kill signal to the children instead when terminating.

@DustinCampbell
Copy link
Member

Thanks for the additional investigation! I see the problem now. About six months we changed our launcher on Unix to a shell script that launches OmniSharp on Mono. When we did that, we failed to update the code that terminates the process to handle the fact that Mono is now a child process of our shell script.

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

No branches or pull requests

2 participants