-
Notifications
You must be signed in to change notification settings - Fork 265
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
remotecfg: fix logic around skipping loaded configuration #2762
Conversation
Signed-off-by: Paschalis Tsilias <[email protected]>
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.
only one nit
Signed-off-by: Paschalis Tsilias <[email protected]>
@@ -480,22 +479,21 @@ func (s *Service) parseAndLoad(b []byte) error { | |||
if len(b) == 0 { | |||
return nil | |||
} | |||
|
|||
s.setLastLoadedCfgHash(getHash(b)) |
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.
is it possible to get a length 0 config and get stuck doing:
good config -> 0 length config -> good config
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.
answered myself: we will never set the 0 length config into the hash OR attempt to load it. looks good!
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.
LGTM!
PR Description
This PR:
currentConfigHash
tolastLoadedConfigHash
.parseAndLoad
, before we attempt to pass it the configuration to the controller, and nowhere elseThe other thing to do would be to remove this logic entirely and only depend on the server's response as to whether we should skip applying configurations or not.
Given this is likely a breaking change, this is our chance to choose what to do here before removing the
private-preview
label from the next release. Thoughts?Which issue(s) this PR fixes
No issue filed.
Notes to the Reviewer
PR Checklist