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 #54257 #54418
Automated cherry pick of #54257 #54418
Conversation
The Get() function of non-namespace lister passes a temporary object to indexer.Get() in order to fetch the actual object from the indexer. This may cause Go to allocate the temporary object on the heap instead of the stack, as it is passed into interfaces. For non-namespaced objects, Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent to GetByKey(name). This could be the root cause of excessive allocations, e.g. in tests clusterRoleLister.Get() has trigger 4 billion allocations. See openshift/origin#16954 Signed-off-by: Christian Heimes <cheimes@redhat.com>
Hi @tiran. 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 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. I understand the commands that are listed here. |
/lgtm @wojtek-t cherrypick approval? |
hack/update-codegen.sh hack/update-bazel.sh Signed-off-by: Christian Heimes <cheimes@redhat.com>
29c82fd
to
a32c8f3
Compare
@jpbetz is 1.8 patch release manager |
/ok-to-test @jpbetz this fix is merged in 1.7 and 1.9, just need 1.8. |
Cherry pick approved for 1.8. |
Need a lgtm and approval from appropriate owners. |
/assign @lavalamp |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enj, lavalamp, tiran Associated issue: 54257 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. |
Cherry pick of #54257 on release-1.8.
#54257: Use GetByKey() in typeLister_NonNamespacedGet
Release note: