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

feat: flagd file polling for offline mode #614

Merged
merged 8 commits into from
Jan 9, 2024

Conversation

Kavindu-Dodan
Copy link
Collaborator

@Kavindu-Dodan Kavindu-Dodan commented Jan 3, 2024

This PR

Enhance flagd in-process offline mode introduced through #473 by adding polling support and align with the change proposed at flagd js-sdk (open-feature/js-sdk-contrib#708)

Polling happens at intervals of 5 seconds and runs concurrently. If an update is observed, connect offers the newest content to the storage through the connector contract.

Note on polling

The reason to use polling is the known limitation of Java WatchService when it comes to non-local file systems. This blog post 1 extensively describes the problem. Besides, the offline mode is intended for limited use cases such as testing, local development efforts or POC deployments where the impact of polling is minimal.

Footnotes

  1. https://blog.arkey.fr/2019/09/13/watchservice-and-bind-mount/

@Kavindu-Dodan Kavindu-Dodan force-pushed the feat/flagd-file-poll branch 9 times, most recently from 1d7d45c to 60d389e Compare January 8, 2024 14:42
Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with this question. I will let you consider it and decide if you think it's something we should worry about in this PR.

@Kavindu-Dodan
Copy link
Collaborator Author

Approving with this question. I will let you consider it and decide if you think it's something we should worry about in this PR.

Thanks for the review. Regarding the concurrency concern, I will address it in a dedicated PR. As described here only possibility for concurrent issues is if the same provider get registered multiple times (which is allowed in spec). And I think we need to check this edge case in other lang. implementations as well.

Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
@Kavindu-Dodan Kavindu-Dodan merged commit 5e97b12 into open-feature:main Jan 9, 2024
4 checks passed
DBlanchard88 pushed a commit to DBlanchard88/java-sdk-contrib that referenced this pull request Apr 29, 2024
…ature#614)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants