-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(watcher): add support for poll watcher #21290
base: master
Are you sure you want to change the base?
feat(watcher): add support for poll watcher #21290
Conversation
3773b14
to
ae66312
Compare
4c926d0
to
1802ece
Compare
} | ||
WatcherConfig::PollWatcher(interval) => { | ||
let config = | ||
notify::Config::default().with_poll_interval(Duration::from_secs(*interval)); |
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.
Should we allow the user to specify compare_contents
? https://docs.rs/notify/latest/notify/struct.Config.html#method.with_compare_contents
maybe another argument? Im afraid we are adding too much arguments for this though
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'd vote against it being user controllable and hope for it to just have a sane default. I can't think of a scenario where I'd wanna toggle it!
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.
We found issues in openshift environments where the inotify watcher was constantly triggered and the file contents did not change at all. In this case, we would like to hash the contents to check if it really changed before reloading vector config. I think having sane defaults is good (for example, this would default to false), but there are situations where this is useful
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.
Would there be a downside to always hashing the changes?
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.
Yes, as the docs I pointed states:
By enabling this feature, performance will be significantly impacted as all files will need to be read and hashed at each poll_interval.
I prefer that downside to be opt-in
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.
IMO it is a reasonable opt-in option that we can include in this PR. To be clear, I don't feel strongly about adding it here and now.
Co-authored-by: Jorge Hermo <[email protected]>
Hey @amribm, thank you for this PR!
|
okay, i will add changelog
Yes This is ready for review , @pront i need some confirmation from vector team for those comments. that's why i didn't resolved them. |
} | ||
WatcherConfig::PollWatcher(interval) => { | ||
let config = | ||
notify::Config::default().with_poll_interval(Duration::from_secs(*interval)); |
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.
IMO it is a reasonable opt-in option that we can include in this PR. To be clear, I don't feel strongly about adding it here and now.
Co-authored-by: Pavlos Rontidis <[email protected]>
Co-authored-by: Pavlos Rontidis <[email protected]>
Co-authored-by: Pavlos Rontidis <[email protected]>
… and docs update
Closes #21111