LuaLS / LuaLS/lua-language-server
lua-language-server exhausts available inotify resources
还没有人认领这个 Issue。
- 主要语言
- Lua
- 星标
- 4.4k
- 派生
- 442
- PR 合并指标
- 30 天内没有已合并 PR
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
按照描述,使用 dummy config、包含许多文件的 workspace 和 inotifywait 重现耗尽问题。然后检查第 34 行附近的 script/provider/provider.lua,其中确定了 watch 行为。当打开 workspace 不再消耗所有可用的 inotify watches,同时 language server 仍能处理已配置的 workspace 时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- linux, lua
- 领域
- devtools, operating-systems
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100