Linux: file watcher feedback loop on .gitignore lookups → 250%+ CPU while idle (2026.9.1, CEF build)
Environment
- Yaak 2026.9.1,
yaak-cef.deb, Ubuntu 22.04 (X11, GNOME), kernel 6.8 - Workspace with a sync directory that is also the root of a git repository (shared with a teammate)
- The repo also contains a
.idea/directory with its own.gitignore
What happens
Right after opening the workspace, with no user activity and no file changes, the main yaak-cef process sits at ~250% CPU (main thread at 100% + one tokio worker at 100% + the notify-rs inotify threads at ~10% each). The whole app uses about 1.3 GB RSS.
Measurements (idle, nothing modified on disk)
- Yaak holds two inotify instances with 270 watches each, covering the whole repo including
.git/. - An independent inotify listener on the same tree records ~42,000 events per second, all
OPEN/ACCESS/CLOSE_NOWRITE. They are split evenly across exactly three files:.git/config.git/info/exclude.idea/.gitignore
/proc/<yaak-cef pid>/ioshows ~90,000 read syscalls per second from Yaak itself.- The
notify-rsthreads do ~16k context switches per second.
Likely cause
The watcher seems to react to read-only events (OPEN/ACCESS/CLOSE_NOWRITE), and for each event it evaluates gitignore rules. That evaluation reads .git/config, .git/info/exclude and the nested .gitignore files, which are inside the watched tree. Those reads produce new access events, so the loop feeds itself forever.
Suggested fixes
- Only subscribe to modify/create/delete/rename events, not
OPEN/ACCESS/CLOSE_NOWRITE. - Don’t watch
.git/at all, or at least ignore events caused by the ignore-rule lookup itself. - Cache the gitignore matcher instead of re-reading the ignore files on every event.
Note 2025.9.3 (WebKitGTK build) also had this, at a lower level: 30–50 min of CPU time per working day. It looks related to Linux app consistently uses 100%+ CPU when idle, which was reported as fixed in 2026.5.0, but the problem still reproduces in 2026.9.1.