Description
Thanos, Prometheus and Golang version used:
reloader used by prometheus-operator
Object Storage Provider:
What happened:
When the CfgFile
is updated atomically which results in the file being deleted and recreated (through temp file and rename or other) the watcher will stop receiving events for the as the original file was deleted.
fsnotify warns about that here https://github.com/fsnotify/fsnotify/blob/a9bc2e01792f868516acf80817f7d7d7b3315409/README.md?plain=1#L128
As a workaround the parent dir of can be added to WatchedDirs
(assuming it doesn't contain noisy files)
Related prometheus-operator PR prometheus-operator/prometheus-operator#7366
What you expected to happen:
watcher should handle atomic updates of CfgFile
How to reproduce it (as minimally and precisely as possible):
run a reloader for a CfgFile
, delete CfgFile
, recreate CfgFile
, change its content, reload will not be triggered immediately, but at the next WatchInterval tick.
Full logs to relevant components:
Anything else we need to know: