-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable polling in file watcher #322
Enable polling in file watcher #322
Conversation
a8df3f3
to
e60958c
Compare
@@ -127,13 +128,19 @@ def __init__( | |||
self, | |||
paths: list[pathlib.Path | str], | |||
event_types: abc.Iterable[EventType] = frozenset(EventType), | |||
*, | |||
enable_polling: bool = True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are using a positive term then I would use the same as watchfiles
(force_polling
), as probably even when passing force_polling=False
(enable_polling=False
) polling will probably be used if I notify or other event based system calls are not available in the OS.
e60958c
to
1570347
Compare
Updated based on initial suggestions from Luca |
Added a new commit to remove the redundant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the same concern as with #321 , this is actually mixing one bug fix (setting force_poll=True
, which depending on how we see it it could even be a breaking change1) and a new feature (being able to configure force_polling
).
Footnotes
-
Maybe this is worth documenting in the
Upgrading
section, mentioning the default mechanism was changed and updates might have a bit of a delay now and watching a large amount of files might be less efficient, and letting the user know how to go back to the previous default. ↩
For simplicity I think we can release all of this in v1.2.0 and that's it. |
3ff9c96
to
82c2156
Compare
Setting platform to predefined $TARGETPLATFORM is redundant as this is the default behavior. Signed-off-by: Daniel Zullo <daniel.zullo@frequenz.com>
82c2156
to
0334cb9
Compare
Updated release-notes to add an entry in |
`inotify` does not work reliably with network file systems (e.g., NFS, CIFS) commonly used in cloud environments. These file systems may not propagate file system events correctly, causing `inotify` to miss changes. To ensure consistent file monitoring across these environments, polling is enabled by default in FileWatcher. Signed-off-by: Daniel Zullo <daniel.zullo@frequenz.com>
2a3f9a3
to
bbb1198
Compare
inotify
does not work reliably with network file systems (e.g., NFS, CIFS) commonly used in cloud environments. Thesefile systems may not propagate file system events correctly, causing
inotify
to miss changes. To ensure consistent filemonitoring across these environments, polling is enabled by default in
FileWatcher
.Fixes #256