nvim-lua / completion-nvim

A async completion framework aims to provide completion to neovim's built in LSP written in Lua
Apache License 2.0
973 stars 78 forks source link

Completion occasionally causes whole nvim session to hang #367

Open jyscao opened 3 years ago

jyscao commented 3 years ago

I don't know how to reproduce this issue consistently, but it happens with enough frequency (1-2x per 6-8 hours of programming) that it has become fairly unpleasant to deal with.

It only occurs when a word comes up in the completion, then my entire nvim session hangs like shown below: image

It could happen in any type of modifiable buffer, not necessarily just in a fugitive gitcommit buffer as shown above. For me this has happened while I'm working in Python, PHP, Vimscript, markdown, text files. My completion_items are: ['lsp', 'snippet', 'buffers', 'ts',].

When I take a look using top, I see a python process using about 85% CPU on a core: image

$ ps -ef | rg python3 shows: image With the offending PID highlighted. Though there are 10 of these same python3 processes as you can see.

I've only been dealing with this bug by using killing that process by sending it sigterm. Then nvim becomes responsive again, always with a - inserted at the position of the cursor in normal mode. When I re-enter insert mode and try to input some characters, each keystroke will cause the following error: image

So at this point, I always just quit my nvim session, then restart it.

sandersantema commented 3 years ago

I've been having the same problem and thought it was my completion plugin too, but given that I currently use deoplete that should be enough of a hint to tell us with quite some certainty it's not the completion. I think that it's a bug in Ultisnips, although searching trough their bug tracker I don't know which one give that there are quite a lot of bug reports about freezing etc. For me it even had an included nasty memory leak which caused my completely freeze up before OOM kicked in, I solved this by running nvim as: systemd-run --scope -p MemoryMax=10G nvim. I don't know of any real solutions as of yet and no other snippet plugin is on par with ultisnips for me :(