-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Automated cherry pick of #118189: TopologyAwareHints: Take lock in HasPopulatedHints #120372
Automated cherry pick of #118189: TopologyAwareHints: Take lock in HasPopulatedHints #120372
Conversation
Prevent potential concurrent map access by taking a lock before reading the topology cache's hintsPopulatedByService map. * staging/src/k8s.io/endpointslice/topologycache/topologycache.go (setHintsLocked, hasPopulatedHintsLocked): New helper functions. These are the same as the existing SetHints and HasPopulatedHints methods except that these helpers assume that a lock is already held. (SetHints): Use setHintsLocked. (HasPopulatedHints): Take a lock and use hasPopulatedHintsLocked. (AddHints): Take a lock and use setHintsLocked and hasPopulatedHintsLocked. * staging/src/k8s.io/endpointslice/topologycache/topologycache_test.go (TestTopologyCacheRace): Add a goroutine that calls HasPopulatedHints.
Hi @Miciah. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/kind bug |
Thanks @Miciah! I'm not sure how we missed this, but probably both the original PR and this one should have had a release note, do you mind adding one here? /sig network |
I've added a short release note. Let me know if it needs to be more detailed. Thanks! |
/lgtm |
LGTM label has been added. Git tree hash: 3c65de790589320677ce269e5d70748f01366369
|
@Miciah @robscott @atiratree I see that this bug is affecting at least Kubernetes v1.27 (#118188). Should this change be cherry-picked to the release-1.27 branch as well and potentially other release branches? |
@xmudrii yes, I think we should cherry pick this back to all supported versions. |
Please get these cherry-picks lgtm-ed+approved as well and I'll be happy to cherry-pick-approve these PRs. |
Done, thanks! |
@robscott you probably opened a wrong tab for the 1.26 one :) |
🤦 should be good now, I managed to approve one of the cherry-picks 2x... |
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.
Thanks a lot everyone for providing feedback on this!
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Miciah, robscott, xmudrii The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
Cherry pick of #118189 on release-1.28.
#118189: TopologyAwareHints: Take lock in HasPopulatedHints
For details on the cherry pick process, see the cherry pick requests page.