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

choosenim causes child nimsuggest processes not to be killed on server shutdown, when using nimlangserver #13

Open
RokkuCode opened this issue Aug 24, 2024 · 0 comments

Comments

@RokkuCode
Copy link

RokkuCode commented Aug 24, 2024

(Copy from dom96/choosenim#339)

This issue is currently breaking the user experience with Nim and vscode. Users who simply want to try Nim and install Nim and vscode with the langserver + plugin are faced with the problem that it does not work and throws errors.
Maybe a solution would be to temporarily abandon the proxy binaries and just use symlinks on Linux as seen in a fork of choosenim under https://github.com/ire4ever1190/choosenim/pull/18/files


Here's the original issue, reported in the nimlangserver:

nim-lang/langserver#184

It turned out this issue only occurs when choosenim is used. When nimlangserver is shut down, it sends SIGTERM signals to its nimsuggest child processes. Since choosenim inserts a proxy process between the real nimsuggest and nimlangserver, when the server is shut down, only the proxy is killed, leaving the real nimsuggest processes running and consuming memory.

I think the choosenim proxy should be modified in such a way, so that it doesn't leave processes running, when it's killed. One way to do it is to handle the SIGTERM signal (and the equivalent on Windows). Another possible solution is to use the execve() family of functions to spawn the real nimsuggest process, thus replacing the proxy process with the real nimsuggest, using the same process id.


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

No branches or pull requests

1 participant