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

Impossible to prevent process.exit? #364

Closed
chrismwendt opened this issue Jun 21, 2018 · 6 comments
Closed

Impossible to prevent process.exit? #364

chrismwendt opened this issue Jun 21, 2018 · 6 comments
Labels
*out-of-scope Posted issue is not in scope of VS Code

Comments

@chrismwendt
Copy link
Contributor

https://github.com/Microsoft/vscode-languageserver-node/blob/6d8ddcc7c2b4f65a7861438df88d46ed4b250fca/server/src/main.ts#L1714-L1735

Is it impossible to prevent process.exit in onExit?

When using TCP streams for LSP communication to a remote language server, it would be great to be able to serve multiple clients with a single process. When the language server process is forced to exit, the only workaround I see is to somehow fork a process on every connection, which is rather difficult/impossible in Node.js.

@dbaeumer
Copy link
Member

In node you could monkey patch process.exit. But I would accept a PR as well which allows the exitHandler to return a boolean to singal if process.exit should run or not.

@dbaeumer
Copy link
Member

And please be aware that the LSP is not designed for multi tenant servers. So there might be issues, especially if two clients touch the same files.

@jonathan-spruce
Copy link

I'm having a similar issue while trying to run a Language Server in a Docker container - since the parent process is not running in the container it exits shortly after connection to the client.

@dbaeumer
Copy link
Member

@jonathan-spruce I assume you are sending a process id from the host in the initialize request to the server running in the container. You can send null so that the node server doesn't do any checking. Or use a process ID that us available in the container but does never exit.

To make this official we would need to allow this in the spec.

@dbaeumer
Copy link
Member

Actually null is already supported. Will update the node files.

@dbaeumer dbaeumer added this to the Backlog milestone Oct 28, 2019
@dbaeumer dbaeumer added the *out-of-scope Posted issue is not in scope of VS Code label Oct 6, 2020
@vscodebot
Copy link

vscodebot bot commented Oct 6, 2020

We closed this issue because we don't plan to address it in the foreseeable future. You can find more detailed information about our decision-making process here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

3 participants