Watch for non-existent files produces constant polling loop
Author: colin-grant-workCreated Sep 21, 2026Updated Oct 1, 2026
Labelsperformancefile-watchers
Bug Description:
If a watch is requested for a file that doesn't exist, we attempt to stat it twice every second forever.
This uses some, though not a lot, of CPU time. We could instead watch an existing parent and wait for create events.
Steps to Reproduce:
- This happens almost all the time, because we, e.g. watch for all user-scoped config files (
tasks.json,settings.json, AI config etc.), so deleting any of those files (~/.theia/settings.json, etc.) while cause us to enter this loop.
Additional Information
- Operating System: MacOS
- Theia Version: 98d1a268f03bc1a6709b0fbf6842c54c2ee13ccb
Source: eclipse-theia/theia