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] Detect stale flags #400

Open
Kavindu-Dodan opened this issue Feb 10, 2023 · 4 comments
Open

[FEATURE] Detect stale flags #400

Kavindu-Dodan opened this issue Feb 10, 2023 · 4 comments
Labels
enhancement New feature or request Needs Triage This issue needs to be investigated by a maintainer question Further information is requested

Comments

@Kavindu-Dodan
Copy link
Contributor

Kavindu-Dodan commented Feb 10, 2023

Requirements

Background

Consider this conversation [1]. Flagd can operate with multiple sync providers. These sync providers push flag configurations which get stored in the internal in-memory store [2].

There could be occasions where individual providers shutdown, and disconnect for various reasons. For example, for an HTTP flag source, the source can undergo maintenance causing downtime. When this happens, flags stored internally could go stale

Proposal

As highlighted by the conversation [1], it could be beneficial to mark stored flag configurations to be stale and set state Reason.STALE for evaluations. This makes sure flag configurations served by flagd are consistent with their sources.

Update
Given that we do not have a stale sate in existing evaluation reasons [3], a good alternative is to utilize CACHED state

[1] - #297 (comment)
[2] - https://github.com/open-feature/flagd/tree/main/pkg/store
[3] - https://docs.openfeature.dev/docs/specification/types#resolution-details

@Kavindu-Dodan Kavindu-Dodan added enhancement New feature or request Needs Triage This issue needs to be investigated by a maintainer labels Feb 10, 2023
@Kavindu-Dodan Kavindu-Dodan added the question Further information is requested label Feb 10, 2023
@beeme1mr
Copy link
Member

Hey @Kavindu-Dodan, is this issue still relevant? If so, how critical do you think it is to add support for stale flag detection?

@Kavindu-Dodan
Copy link
Contributor Author

@beeme1mr concern highlighted in the issue is still relevant. One option is to set the resolution state to "CACHED" when the underlying source goes offline

@toddbaert what do you think?

@toddbaert
Copy link
Member

toddbaert commented Mar 16, 2023

I think it makes sense to set it to cached in this case, ya.

We may want to add a STALE to the spec at some point, but until then I think I'd prefer CACHED (even though reasons are free-form).

@beeme1mr
Copy link
Member

STALE is now included in the OpenFeature spec.

https://openfeature.dev/specification/types#resolution-details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Needs Triage This issue needs to be investigated by a maintainer question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants