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

Shutdown ycmd if the editor is gone? #927

Closed
sam-mccall opened this issue Feb 15, 2018 · 12 comments
Closed

Shutdown ycmd if the editor is gone? #927

sam-mccall opened this issue Feb 15, 2018 · 12 comments

Comments

@sam-mccall
Copy link

If I start vim + YCM, ycmd is a child of vim.

Then if vim exits uncleanly, ycm keeps running as a child of init.
Can ycmd detect this and shut down?

I'm still trying to debug why vim+ycm isn't shutting down ycmd in my setup, but this seems like a reasonable robustness/defense-in-depth measure. When I noticed the problem I had 10s of ycmds running, each with a language server hanging off it...

@bstaletic
Copy link
Collaborator

bstaletic commented Feb 15, 2018 via email

@micbou
Copy link
Collaborator

micbou commented Feb 15, 2018

@micbou
Copy link
Collaborator

micbou commented Feb 15, 2018

By the way, ycmd not shutting down after exiting Vim could be due to a bad interaction with another plugin. See this entry in the FAQ.

@puremourning
Copy link
Member

When I noticed the problem I had 10s of ycmds running, each with a language server hanging off it...

I take it you’re using the java completer? Could you post the logs please ?

@sam-mccall
Copy link
Author

Thanks, I did find the FAQ entry and eventually tracked it down to an old script I had installed. That makes VimLeave seem like a pretty fragile mechanism to rely on, so I guess I should expect the timeout to be the way ycmd shuts down for some fraction of users.

I guess the timeout works well enough. I was remembering it being ~a day, but looks like that changed years ago. 30 minutes is still a bit inconvenient:

  • the language server eats multiple GB of ram (it didn't free any because it doesn't know the docs are closed)
  • a workflow that ends up opening and closing vim a lot can end up with a lot of ycmds in 30 minutes (I ended up with 15 running when I checked)

It seems like losing the parent could result in shutdown within seconds instead of minutes, but maybe this isn't worth fixing.

@puremourning It's not the Java language server, but rather clangd with a fairly simple out-of-tree completer (would be nice to upstream it at some point, but my attempts to slot clangd into the LSP completer framework didn't work well so far). Happy to share our completer and my attempt at using the upstream LSP support if that'd be helpful.

@bstaletic
Copy link
Collaborator

bstaletic commented Feb 15, 2018 via email

@sam-mccall
Copy link
Author

Cool! No parity with libclang on the clangd side or ycmd side?

The issues I remember were:

  • stale diagnostics lingering
  • should bypass YCMD's completion cache for better ranking
  • I think the LSP plugin didn't have full command support (for fixits)?

We think/hope clangd is are parity feature-wise, if not stability

@sam-mccall
Copy link
Author

Sorry, this is way off topic. I'll open a new issue for clangd support tomorrow unless someone gets there first.

@puremourning
Copy link
Member

clangd... upstream...

I wrote a clangd completer implementation as part of the development of the java completer.

this was working at one point, and took about 30 minutes to integrate with our LSP implementation. I doubt it works now, due to API changes during code review

full details on the java PR description

@bstaletic
Copy link
Collaborator

bstaletic commented Feb 15, 2018 via email

@puremourning
Copy link
Member

I realise that, i was responding to:

but my attempts to slot clangd into the LSP completer framework didn't work well so far

@puremourning
Copy link
Member

Thanks, I did find the FAQ entry and eventually tracked it down to an old script I had installed

Given that the server shuts down after 30 mins of inactivity and you're not using an "official" completer, and the problem was with another plugin... I think we can close this.

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

4 participants