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

LSP Hanging on Close, Freezing after a few seconds and then suddenly drawing a lot of system resources. #986

Open
sweetbbak opened this issue Oct 1, 2023 · 9 comments

Comments

@sweetbbak
Copy link

Code editor

Helix, Neovim

Platform

Unix

Version

5.0.0

What steps will reproduce the bug?

Opening my editor (Helix in this case) the LSP will start, it will make the usual corrections and suggestions... but then it will freeze within a few seconds, become unresponsive and start to eat up a ton of CPU power. It starts to sound like my PC is a helicopter attempting to takeoff. Then closing the editor, the editor will hang and throw an error that says "The LSP is unresponsive / did not close correctly"

How often does it reproduce? Is there a required condition?

Every single time I use bash-language-server and open a shell script. Disabling bash-language-server is the only thing that fixes the issue.

What is the expected behavior?

No response

What do you see instead?

LSP immediately freezing
Hanging on Close
Increased CPU usage by quite a lot

Additional information

No response

@sweetbbak
Copy link
Author

bash-language-server has been completely unusable. It continues to use extremely high CPU and hang indefinitely on close.

@sweetbbak
Copy link
Author

Temporary solution is downgrading to version 4.10.2-1

@palansher
Copy link

Holy fuck! Seems I fixed it. I deleted bashIde.globPattern ext. setting at all for all locatiions (User, Remote ..).
It was default value: **/*@(.sh|.inc|.bash|.command)
Now it is empty "bashIde.globPattern": ""

image

No CPU eating now. It seems a bug.

I even don't know the purpose of bashIde.globPattern. The extension still working as previous.

@sweetbbak
Copy link
Author

its using globbing to find files with those extensions so it can find/parse functions and variables in other files. **/* is recursive globbing and @(.x|.y|.z) is a capture group for things that end with those extensions. That could certainly take a lot of CPU, especially with a lot of sub-directories.

I'm not 100% sure if that came from bash-language-server (or vscode/another extension), but its good to know in-case anyone wants to bisect this issue across the last few versions.

@palansher
Copy link

I think it is a bug, because my Workspace contains only 10 small shell files.

@samuelpx
Copy link

I'm experiencing a related issue, not sure if it has the same RC. When opening any file on nvim that will trigger bash-lsp attachment AND editing and closing quickly, the behaviour described by the OP occurs i.e (Hanging on Close, Increased CPU usage by quite a lot). This completely locks-up my WSL machine.

@sweetbbak
Copy link
Author

It's definitely related as I have that same thing happen. The solution was to downgrade the version to the last major release. Im pretty sure this was introduced due to auto-bumped dependencies and the globbing pattern when it comes to larger directories.

@samuelpx
Copy link

Downgrading worked, will keep checking future releases for a fix, thank you, lain drinking purple monster!

@polyzen
Copy link
Contributor

polyzen commented May 10, 2024

This occurs for me on (Arch) WSL even with 4.10.2.

Edit: Also with 3.3.1. Was hoping to find a point to bisect from 😢
Edit 2: Using Neovim 0.9.5

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