Skip to content

Conversation

@andrewphelpsj
Copy link

Hello! This patch is a small fix to a data race. If the calling code reads from the channel provided via QueryParam.Entries, there is a chance that they read from a pointer that is being mutated by the code in client.query. This happens because we mutate the data that the pointer points to, even after we send that pointer over the channel.

It looks like there was an attempt at fixing this a couple years ago: #75. The change proposed here differs a little bit, since I'm doing a deep copy of all of the data. This should prevent the calling code from messing with the internal state of the client.

It seems like this might not be the approach you all want, so if there is another potential solution, let me know and I'll be happy to try and submit a patch!

@andrewphelpsj andrewphelpsj requested review from a team as code owners April 29, 2025 17:42
@hashicorp-cla-app
Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

1 similar comment
@hashicorp-cla-app
Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

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.

1 participant