Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Make lsp more resilient for language server crashes #65

Open
andre2007 opened this issue Feb 21, 2019 · 5 comments
Open

Make lsp more resilient for language server crashes #65

andre2007 opened this issue Feb 21, 2019 · 5 comments
Milestone

Comments

@andre2007
Copy link

This is somehow related to #58 but goes in another direction.

In case a language server dies (e.g. the executable crashes) this should not cause lsp to stop working, but lsp should be resilient. It should catch the issue and restartet the language server automatically.

Also there should be no modal info box shown but the crash should be logged.
(if needed I can attach a screenshot of this crash info boxes, next time it occurs)

@gtache
Copy link
Owner

gtache commented Feb 23, 2019

What I'm doing at the moment is that if a server crashes twice, I'll inform the user. I could raise this value obviously (to something like 5), but I'm in fact restarting the server when it happens.
The thing is, when a server crashes several times, it probably won't work without having the user look into it, hence the info message. I could make it fail silently and make the crash information available when clicking on the server status icon though, which could be less intrusive (but also make the error less visible).

@andre2007
Copy link
Author

When the server (dls in my case) crashes I get the info message you mentioned but also the LSP traffic icon disappears and I have to restart the whole IntelliJ to see the LSP traffic icon again.
As far as I understand you, this should not happen?

@andre2007
Copy link
Author

@gtache In case of a crash, where can I find the content of stderr? I need this information to check why the language server (dls) crashed and how this can be avoided in future.

See also here d-language-server/dls#32

@gtache
Copy link
Owner

gtache commented Mar 1, 2019

At the moment the server log is not saved, but it is implemented in #72. I'll release it along with some bugfixes if I can find their causes.
Regarding your previous question, it is the intended behavior for now, but it is changed in 1.6.0 (and the restart function is also added).

@floitsch
Copy link

floitsch commented Mar 6, 2019

Fyi: the vscode client keeps track of how often the server died within the last three minutes. If that number exceeds 5, if won't restart the server:
https://github.com/Microsoft/vscode-languageserver-node/blob/master/client/src/client.ts#L279

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

No branches or pull requests

3 participants