Skip to content
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

[FEATURE] filepath sync to poll version, in addition to using fsnotify #1344

Closed
toddbaert opened this issue Jul 2, 2024 · 0 comments · Fixed by #1365
Closed

[FEATURE] filepath sync to poll version, in addition to using fsnotify #1344

toddbaert opened this issue Jul 2, 2024 · 0 comments · Fixed by #1365
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@toddbaert
Copy link
Member

toddbaert commented Jul 2, 2024

Requirements

Until now, we've been using fsnotify for watching files for change. This works well in K8s and most "prod" situations.

Unfortunately, due to the complexities and inconsistencies across OSes and editors, this simply doesn't work well in many developer cases, and even some prod cases (OSes and editors all send different combinations of events, some create temp files and move them, some use symlinks, etc, etc).

It's unreasonable to support all these different situations. I propose we add an additional mode or version of the filepath Sync to start a goroutine which uses os.Stat() to get the fs.FileInfo, noting the current time (time) and then we check fileInfo.ModTime().After(time) every n seconds and fire a sync event with new contents if we see it's changed. I think by default, n should be 1000ms, but it should be configurable. We could use some kind of startup param to select this mode and the poll internal.

cc @Kavindu-Dodan

@toddbaert toddbaert added enhancement New feature or request Needs Triage This issue needs to be investigated by a maintainer good first issue Good for newcomers help wanted Extra attention is needed and removed Needs Triage This issue needs to be investigated by a maintainer labels Jul 2, 2024
@toddbaert toddbaert changed the title [FEATURE] modify filepath sync to poll, instead of using fsnotify [FEATURE] filepath sync to poll version, instead of using fsnotify Jul 2, 2024
@toddbaert toddbaert changed the title [FEATURE] filepath sync to poll version, instead of using fsnotify [FEATURE] filepath sync to poll version, in addition to using fsnotify Jul 3, 2024
djosephsen added a commit to djosephsen/flagd that referenced this issue Jul 22, 2024
Implement fsnotify and `os.Stat` based watchers

fixes: open-feature#1344

Signed-off-by: Dave Josephsen <[email protected]>
djosephsen added a commit to djosephsen/flagd that referenced this issue Jul 30, 2024
Implement fsnotify and `os.Stat` based watchers

fixes: open-feature#1344

Signed-off-by: Dave Josephsen <[email protected]>
@beeme1mr beeme1mr removed the help wanted Extra attention is needed label Aug 2, 2024
djosephsen added a commit to djosephsen/flagd that referenced this issue Aug 14, 2024
Implement fsnotify and `os.Stat` based watchers

fixes: open-feature#1344

Signed-off-by: Dave Josephsen <[email protected]>
toddbaert added a commit to open-feature/community that referenced this issue Aug 14, 2024
@djosephsen has been helping with flagd features, specifically open-feature/flagd#1344

Signed-off-by: Todd Baert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants