Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix: Do not remove features cache if upstream goes away #362
fix: Do not remove features cache if upstream goes away #362
Changes from 1 commit
6c7337a
3509e5f
06eb4d4
c5d119e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
What happens when upstream is back online? I think 404 response code depends on each server/LB implementation, but maybe one reason for 404 is no pods available in a k8s cluster.
If we consider the backoff implementation we did in the SDKs I think this is correct as it's aligned with that. I'm just wondering if this behavior changes when edge is still not ready (i.e. before receiving at least 1 successful response from upstream)
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.
This sounds relevant, but it's a little early for me to understand exactly what you're saying 🥱 Would you be willing to explain this comment a little more for me?
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.
So, every time the same key gets used we do the evaluation in the following order
2a. We have equal or wider access to the token's environment already, if so, we should be able to get features from the feature cache
2b We do not have equal or wider access, add the token to the list of tokens our FeatureRefresher cares about
What Gaston is worrying about is whether or not we repeat step 2, if upstream comes back online. From what I gather, we'll attempt to register it for refresh once every hour for normal tokens. I'm starting to think we should change the default here to 5 minutes or so.
For startup tokens, we try once every second until they achieve TokenStatus::Validated, then they too get moved into the refresh once per hour.
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.
Right, and by step 2, you're referring to
Right? Or 2a/2b? Anyway, it sounds like you've got it covered?
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.
The crux is here. Previously, when we receive 404 or connection failed we'd remove the features_cache and the engine_cache as well, thus removing all the durability built into Edge for when upstream goes away.