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

Fix priority expander falling back to random although higher priority matches #3308

Merged
merged 1 commit into from
Aug 5, 2020

Conversation

bruecktech
Copy link
Contributor

@bruecktech bruecktech commented Jul 9, 2020

When an option matches in a low priority together with another option both get added to the best list where the random expander fallback strategy finally selects one option randomly although one of the options also matches in a higher priority.
This PR ensures all priorities are evaluated for an option and higher ones take precedence by removing the break in the loop. The root cause is that the map of priorities is unordered and therefore we have to walk to the end

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jul 9, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @bruecktech!

It looks like this is your first PR to kubernetes/autoscaler 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/autoscaler has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 9, 2020
@k8s-ci-robot k8s-ci-robot requested review from Jeffwan and losipiuk July 9, 2020 11:31
@bruecktech
Copy link
Contributor Author

CLA is signed now

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 9, 2020
@MaciekPytel MaciekPytel reopened this Jul 30, 2020
@MaciekPytel
Copy link
Contributor

/lgtm
/approve

Sorry for the long wait. Re-opening to trigger presubmits re-run (since the previous run was quite old).

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 30, 2020
@MaciekPytel
Copy link
Contributor

MaciekPytel commented Jul 30, 2020

/lgtm cancel
I just realized this PR is to 1.16 and not master branch. The problem with this is that it will regress in any future version and so the way to fix this would be to make a PR to master and later cherry-pick it to all the way down through branches (ie. to 1.18, 1.17 and 1.16).

@MaciekPytel MaciekPytel removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 30, 2020
@bruecktech bruecktech changed the base branch from cluster-autoscaler-release-1.16 to master July 31, 2020 04:55
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 31, 2020
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 31, 2020
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 31, 2020
@bruecktech
Copy link
Contributor Author

@MaciekPytel I changed the PR to be against master now

@nitrag
Copy link
Contributor

nitrag commented Aug 4, 2020

This didn't make the 1.15.7 release :(

@Jeffwan
Copy link
Contributor

Jeffwan commented Aug 5, 2020

@nitrag Maybe we can bring to next release.

@MaciekPytel
Copy link
Contributor

/lgtm
/approve
I see no reason not to bring it to next round of patch releases. Please feel free to open cherry-pick PRs and I'm happy to accept them. As I mentioned before my only requirement is that it needs to be cherry-picked to all branches newer than the one you're targeting (ie. if you need it in 1.16 you should also cherry-pick to 1.17-1.19). The reason is to avoid regressions as people upgrade their cluster.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 5, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MaciekPytel

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 852ea80 into kubernetes:master Aug 5, 2020
@bruecktech bruecktech deleted the fix-fallback branch August 17, 2020 09:55
nitrag pushed a commit to nitrag/autoscaler that referenced this pull request Oct 5, 2020
Fix priority expander falling back to random although higher priority matches
nitrag pushed a commit to nitrag/autoscaler that referenced this pull request Oct 5, 2020
Fix priority expander falling back to random although higher priority matches
nitrag pushed a commit to nitrag/autoscaler that referenced this pull request Oct 5, 2020
Fix priority expander falling back to random although higher priority matches
nitrag pushed a commit to nitrag/autoscaler that referenced this pull request Oct 5, 2020
Fix priority expander falling back to random although higher priority matches
nitrag pushed a commit to nitrag/autoscaler that referenced this pull request Oct 5, 2020
Fix priority expander falling back to random although higher priority matches
k8s-ci-robot added a commit that referenced this pull request Oct 7, 2020
Cherry pick #3308 onto 1.16 -Fix priority expander falling back to random although higher priority matches #3308
k8s-ci-robot added a commit that referenced this pull request Oct 7, 2020
Cherry pick #3308 onto 1.17 - Fix priority expander falling back to random although higher priority matches
k8s-ci-robot added a commit that referenced this pull request Oct 7, 2020
Cherry pick #3308 onto 1.15 - Fix priority expander falling back to random although higher priority matches
colin-welch pushed a commit to Paperspace/autoscaler that referenced this pull request Mar 5, 2021
Fix priority expander falling back to random although higher priority matches
colin-welch pushed a commit to Paperspace/autoscaler that referenced this pull request Mar 5, 2021
Fix priority expander falling back to random although higher priority matches
cablespaghetti pushed a commit to cablespaghetti/autoscaler that referenced this pull request Mar 19, 2021
Fix priority expander falling back to random although higher priority matches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants