config reload: rename-safe (watch dir not file, react to moved/created not just modified) — cfg-05
This commit is contained in:
@@ -31,3 +31,13 @@ and all responder `.config` references is scheduled onto the event
|
||||
loop (`call_soon_threadsafe`), so no request ever reads a
|
||||
half-swapped config (D9). Before the loop runs (startup), the swap
|
||||
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
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user