intellij-lsp icon indicating copy to clipboard operation
intellij-lsp copied to clipboard

Make lsp more resilient for language server crashes

Open andre2007 opened this issue 6 years ago • 5 comments

This is somehow related to https://github.com/gtache/intellij-lsp/issues/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)

andre2007 avatar Feb 21 '19 19:02 andre2007

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).

gtache avatar Feb 23 '19 16:02 gtache

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 avatar Feb 23 '19 20:02 andre2007

@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 https://github.com/d-language-server/dls/issues/32

andre2007 avatar Feb 28 '19 18:02 andre2007

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).

gtache avatar Mar 01 '19 10:03 gtache

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

floitsch avatar Mar 06 '19 14:03 floitsch