Closed hejops closed 2 years ago
I'm fairly certain this is due to coc-sh (disabling coc-diagnostic did not produce any improvements), and it only happens on my Ubuntu machine (it works normally on Manjaro). I updated the post to add some CocInfo logs, as well as my OS information.
As a workaround, I have the following condition in my .vimrc
to disable loading the extension on my affected machine.
let g:coc_global_extensions = [ ... ]
let hostname = substitute(system('hostname'), '\n', '', '')
if hostname != "bad_machine"
let g:coc_global_extensions += ['coc-sh']
endif
I am encountering the same issue on my Debian 10 machine using nvim. But it's not spikes but a constant 100%-200% cpu usage.
:CocInfo
## versions
vim version: NVIM v0.5.0-dev+1166-g070e084a6
node version: v14.16.0
coc.nvim version: 0.0.80-89a2dc8fc8
coc.nvim directory: /home/faivre/configfiles/vim/bundle/coc.nvim
term: xterm-256color
platform: linux
## Log of coc.nvim
2021-04-30T17:27:23.602 INFO (pid:17654) [services] - registered service "diagnostic-languageserver"
2021-04-30T17:27:23.660 INFO (pid:17654) [coc-git] - Looking for git in: git
2021-04-30T17:27:23.675 INFO (pid:17654) [services] - registered service "highlight"
2021-04-30T17:27:23.690 INFO (pid:17654) [plugin] - coc.nvim 0.0.80-89a2dc8fc8 initialized with node: v14.16.0 after 158ms
2021-04-30T17:27:23.694 INFO (pid:17654) [language-client-index] - highlight started with 17669
2021-04-30T17:27:24.069 INFO (pid:17654) [attach] - receive notification: highlight []
2021-04-30T17:27:24.664 INFO (pid:17654) [services] - registered service "pyright"
2021-04-30T17:27:25.541 INFO (pid:17654) [attach] - receive notification: highlight []
2021-04-30T17:27:28.237 INFO (pid:17654) [services] - diagnostic language service state change: stopped => starting
2021-04-30T17:27:28.251 INFO (pid:17654) [language-client-index] - diagnostic-languageserver started with 17771
2021-04-30T17:27:28.254 INFO (pid:17654) [services] - registered service "sh"
2021-04-30T17:27:28.254 INFO (pid:17654) [services] - bash-language-server state change: stopped => starting
2021-04-30T17:27:28.258 INFO (pid:17654) [language-client-index] - Language server "sh" started with 17777
2021-04-30T17:27:28.356 INFO (pid:17654) [services] - diagnostic language service state change: starting => running
2021-04-30T17:27:28.357 INFO (pid:17654) [services] - service diagnostic-languageserver started
2021-04-30T17:27:29.217 INFO (pid:17654) [attach] - receive notification: highlight []
2021-04-30T17:27:41.851 INFO (pid:17654) [attach] - receive notification: highlight []
2021-04-30T17:27:43.907 INFO (pid:17654) [attach] - receive notification: showInfo []
Something is actively polling something. I used strace to do a quick check. I had to remove the futex syscall as it was flooding the logs:
$ strace -p 16421
[...]
futex(0x446c720, FUTEX_WAKE_PRIVATE, 1) = 1
[...]
$ strace -p 16421 -e 'trace=!futex'
[...]
read(16, "\1\0\0\0\0\0\0\0", 1024) = 8
epoll_wait(13, [{EPOLLIN, {u32=16, u64=16}}], 1024, 0) = 1
read(16, "\1\0\0\0\0\0\0\0", 1024) = 8
write(1, "Content-Length: 238\r\n\r\n", 23) = 23
write(1, "{\"jsonrpc\":\"2.0\",\"method\":\"windo"..., 238) = 238
epoll_wait(13, [{EPOLLIN, {u32=16, u64=16}}], 1024, 0) = 1
read(16, "\1\0\0\0\0\0\0\0", 1024) = 8
epoll_wait(13, [{EPOLLIN, {u32=16, u64=16}}], 1024, 0) = 1
This is probably just a side-effect of scanning your home folder? See https://github.com/josa42/coc-lua/issues/58 and resolution. Core coc.nvim recently changed behavior to fix this, so maybe it's already fixed for bash-language-server.
As far as I can tell this is finally fixed after https://github.com/neoclide/coc.nvim/commit/39c14a3b888367dcefe9c7808b7a06ffd2452dcf, and I can finally use coc-sh over "raw bash-language-server configuration with a "ignoredRootPaths": ["~"]
setting" which would avoid the issue.
Indeed. An upgrade of coc.nvim seems to have fixed my issue.
Thanks! And sorry for the noise!
On one of my machines, this extension causes my CPU usage to spike to 100% or more. It works normally otherwise (with coc-diagnostic). Other extensions like coc-pyright don't produce any CPU spikes.