LuaLS / LuaLS/lua-language-server

lua-language-server exhausts available inotify resources

オープン
#1,709 コメント 13 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

documentation
主要言語
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
  1. Create a dummy config file (return {}) and place it somewhere with many files (e.g. in home directory).
  2. Specify path to that config via --configpath like in --configpath=$HOME/lsp.lua.
  3. Open some workspace with that configuration (using lsp.vim in Vim9 here, but client shouldn't matter).
  4. Try using inotifywait some/file and observe Failed 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

説明されているとおり、dummy config、多数のファイルがある workspace、inotifywait を使って枯渇を再現します。次に、watch の動作が特定されている script/provider/provider.lua の34行目付近を調べます。workspace を開いても利用可能な inotify watches をすべて消費せず、language server が引き続き設定済みの workspace を処理できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
linux, lua
領域
devtools, operating-systems
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。