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.15.x #20201

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.15.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@rboyer
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict []

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

@hashicorp-cla
Copy link

hashicorp-cla commented Jan 12, 2024

CLA assistant check
All committers have signed the CLA.

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 marked this pull request as ready for review January 12, 2024 21:14
@rboyer rboyer enabled auto-merge (squash) January 12, 2024 21:15
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.
@rboyer rboyer force-pushed the backport/rboyer/fix-agent-config-race/intensely-epic-gorilla branch from 32912ee to ca6c055 Compare January 12, 2024 22:39
@rboyer rboyer disabled auto-merge January 16, 2024 17:11
@rboyer rboyer merged commit eb1c319 into release/1.15.x Jan 16, 2024
91 of 92 checks passed
@rboyer rboyer deleted the backport/rboyer/fix-agent-config-race/intensely-epic-gorilla branch January 16, 2024 17:11
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