You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Normally, nimlangserver keeps track of all its child nimsuggest processes. During a normal shutdown, it kills them, so they're not left running. A normal shutdown implies that the LSP client (e.g. VS Code) sends a shutdown request:
Unfortunately, LSP clients don't always do that due to bugs, resulting in abnormal termination and this creates leftover nimlangserver and/or nimsuggest processes. It is a good idea to make nimlangserver extra robust and shutdown all processes in case of abnormal termination, LSP client crashes, etc. Even though many of these failures are sometimes bugs in the LSP client (such as VS code), users will assume it's a bug in nimlangserver and not their IDE of choice.
Kill child nimsuggest processes in case of abnormal server termination, due to signals, such as SIGTERM, SIGPIPE, etc: bfb8f56
Kill child nimsuggest processes even in case of LSP exit notification, without a preceding LSP shutdown request: c369c2b
The text was updated successfully, but these errors were encountered:
nickysn
changed the title
nimlangserver and nimsuggest cleanup issues on shutdown (leaving processes still running, after exit ot VS Code)
nimlangserver and nimsuggest cleanup issues on shutdown (leaving processes still running, after exit of VS Code)
Dec 14, 2023
Normally, nimlangserver keeps track of all its child nimsuggest processes. During a normal shutdown, it kills them, so they're not left running. A normal shutdown implies that the LSP client (e.g. VS Code) sends a shutdown request:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#shutdown
followed by an exit notification:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#exit
Unfortunately, LSP clients don't always do that due to bugs, resulting in abnormal termination and this creates leftover nimlangserver and/or nimsuggest processes. It is a good idea to make nimlangserver extra robust and shutdown all processes in case of abnormal termination, LSP client crashes, etc. Even though many of these failures are sometimes bugs in the LSP client (such as VS code), users will assume it's a bug in nimlangserver and not their IDE of choice.
shutdown
withoutparams
: 0976b96exit
withoutparams
: ed819canimsuggest --clientProcessId:XXX
command line option (only if new nimsuggest version is detected)initialize
LSP request. Shutdown server if needed.--clientProcessId=XXX
command line option to nimlangserver, as recommended in the LSP specification here: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#implementationConsiderations 46329eaThe text was updated successfully, but these errors were encountered: