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

command/agent: don't re-parse the flags on reload #4185

Merged
merged 1 commit into from
Jun 1, 2018
Merged

Conversation

kyhavlov
Copy link
Contributor

@kyhavlov kyhavlov commented Jun 1, 2018

Consul was calling flags.Parse on reload which would cause watches (and potentially other slice fields in the config) to be re-appended each time.

Fixes #4179.

@kyhavlov kyhavlov requested a review from mkeeler June 1, 2018 00:03
Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

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

This looks good to me.

Just to make sure I understand the reasoning: re-parsing the flags causes extra config files and hcl fragments to get appended to the slices in the Flags struct? Then when building out the Config a config file is loaded multiple times (1 + number of reloads) causing watches within to be appended once for each time the file is processed.

@kyhavlov
Copy link
Contributor Author

kyhavlov commented Jun 1, 2018

Yeah that was the cause, it was making reloadWatches create more and more watches each time it was called.

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.

2 participants