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

Backport of agent: remove data race in agent config into release/1.17.x #20203

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #20200 to be assessed for backporting due to the inclusion of the label backport/1.17.

The below text is copied from the body of the original PR.


Description

To fix an issue displaying the current reloaded config in the v1/agent/self endpoint #18681 caused the agent's internal config struct member to be deepcopied and replaced on reload.

This is not safe because the field is not protected by a lock, nor should it be due to how it is accessed by the rest of the system.

This PR does the same deepcopy, but into a new field solely for the point of capturing the current reloaded values for display purposes. If there has been no reload then the original config is used.


Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/rboyer/fix-agent-config-race/arguably-charming-mite branch from ac50253 to d3a0bd9 Compare January 12, 2024 21:11
Copy link
Collaborator

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

@rboyer rboyer force-pushed the backport/rboyer/fix-agent-config-race/arguably-charming-mite branch from d3a0bd9 to 052cc31 Compare January 12, 2024 22:38
@rboyer rboyer enabled auto-merge (squash) January 12, 2024 22:39
@rboyer rboyer disabled auto-merge January 16, 2024 17:10
@rboyer rboyer merged commit 5d350c6 into release/1.17.x Jan 16, 2024
97 checks passed
@rboyer rboyer deleted the backport/rboyer/fix-agent-config-race/arguably-charming-mite branch January 16, 2024 17:10
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