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