LuaLS / LuaLS/lua-language-server
lua-language-server exhausts available inotify resources
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
How are you using the lua-language-server?
Other
Which OS are you using?
Linux
What is the issue affecting?
Other
Expected Behaviour
Using lua-language-server shouldn't consume all available inotify resources.
Actual Behaviour
After opening a project no other application can use inotify, because recursive inotify can try watching too many files (over 125,000 in my case, but depends on the limit).
Reproduction steps
- Create a dummy config file (
return {}) and place it somewhere with many files (e.g. in home directory). - Specify path to that config via
--configpathlike in--configpath=$HOME/lsp.lua. - Open some workspace with that configuration (using
lsp.vimin Vim9 here, but client shouldn't matter). - Try using
inotifywait some/fileand observeFailed to watch some/file; upper limit on inotify watches reached!, which shouldn't happen.
Additional Notes
Watch probably shouldn't be recursive when used in https://github.com/sumneko/lua-language-server/blob/d33debdaa7d8748beef0e0365f0314222006058e/script/provider/provider.lua#L34
Log File
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the exhaustion using the dummy config, a workspace with many files, and inotifywait as described. Then inspect script/provider/provider.lua around line 34, where the watch behavior is identified. Done means opening the workspace no longer consumes all available inotify watches, while the language server still handles the configured workspace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, lua
- Domain
- devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100