-
Notifications
You must be signed in to change notification settings - Fork 983
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
fix: Ensure shallow copy of data when returning back cached data #6167
fix: Ensure shallow copy of data when returning back cached data #6167
Conversation
✅ Deploy Preview for karpenter-docs-prod canceled.
|
34a69c1
to
ead406e
Compare
Pull Request Test Coverage Report for Build 9036330896Details
💛 - Coveralls |
001b071
to
74089d3
Compare
74089d3
to
067ecfd
Compare
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 just two questions
067ecfd
to
1af3a37
Compare
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.
/karpenter snapshot
Snapshot successfully published to
|
1af3a37
to
986794a
Compare
Hi @jonathan-innis |
Fixes #N/A
Description
Ensure the slices are shallow copied before returning back cached data from the caller. This ensures if the slice of the data is manipulated by the caller (like sorted), it doesn't affect the original copy that is stored and cached.
This can particularly be a problem when sorts are occurring on the original data in a multi-threaded manner. Because of swaps, this can cause the same data to appear multiple times or to be altered in ways that are inconsistent.
How was this change tested?
make presubmit
Does this change impact docs?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.