config reload: fix feedback loop — react to modified/created/moved only, not open/close (v3.12.1 spun cpu on read-opens)

This commit is contained in:
Oleksandr Kozachuk
2026-07-14 21:30:43 +02:00
parent ef62cb41a5
commit da50395dc7
3 changed files with 30 additions and 10 deletions
+6 -3
View File
@@ -35,9 +35,12 @@ applies directly — there are no concurrent readers yet.
### CFG-05 — Hot-reload is rename-safe (coverage: test)
The watcher observes the config file's **directory**, not the file, and
reacts to any event (modified, created, moved) whose source or
reacts to a **modified, created, or moved** event whose source or
destination path is the config file. This catches atomic saves — write
a temp file, then rename it over the target — which replace the inode
and fire a move/create rather than a modify; watching the file directly
would go deaf after the first such save. Events for other files in the
directory, and directory events themselves, are ignored.
would go deaf after the first such save. Open/close events are
deliberately not handled: reloading re-opens the file to read it, so
reacting to opens would feed back into an endless reload loop. Events
for other files in the directory, and directory events themselves, are
ignored.