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

More assertive borrowing by exempt #124736

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MikeSpreitzer
Copy link
Member

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR changes the way that exempt priority levels borrow from non-exempt ones in API Priority and Fairness. Note that the code does not match the KEP on this matter, which is Issue #124125 . This PR shifts the code to a middle position. A companion PR (kubernetes/enhancements#4623) shifts the KEP to the same place.

Which issue(s) this PR fixes:

This is the code part of one possible way to addressing #124125 .

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/1040-priority-and-fairness

Happy middle ground with what the KEP says?

Signed-off-by: Mike Spreitzer <mspreitz@us.ibm.com>
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 8, 2024
@k8s-ci-robot k8s-ci-robot added area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 8, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MikeSpreitzer

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2024
@MikeSpreitzer
Copy link
Member Author

/cc @tkashem
/cc @wojtek-t
/uncc @yue9944882

@wojtek-t
Copy link
Member

wojtek-t commented May 8, 2024

This change makes sense to me, but we need some tests for it...

@wojtek-t wojtek-t self-assigned this May 8, 2024
@fedebongio
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 14, 2024
@MikeSpreitzer
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 12, 2024
Signed-off-by: Mike Spreitzer <mspreitz@us.ibm.com>
@MikeSpreitzer
Copy link
Member Author

Here is an example of running the new unit test:

mspreitz@mjs13 flowcontrol % go test . -v -run TestUpdateBorrowing
=== RUN   TestUpdateBorrowing
    exempt_borrowing_test.go:82: Scenario 1: expected and got 970 for exempt
    exempt_borrowing_test.go:87: Scenario 1: expected and got 120 for hi
    exempt_borrowing_test.go:92: Scenario 1: expected and got 60 for mid
    exempt_borrowing_test.go:97: Scenario 1: expected and got 30 for lo
    exempt_borrowing_test.go:113: Scenario 2: expected and got 330 for exempt
    exempt_borrowing_test.go:118: Scenario 2: expected and got 180 for hi
    exempt_borrowing_test.go:123: Scenario 2: expected and got 330 for mid
    exempt_borrowing_test.go:128: Scenario 2: expected and got 30 for lo
    exempt_borrowing_test.go:146: Scenario 3: expected and got 540 for exempt
    exempt_borrowing_test.go:151: Scenario 3: expected and got 240 for hi
    exempt_borrowing_test.go:156: Scenario 3: expected and got 60 for mid
    exempt_borrowing_test.go:161: Scenario 3: expected and got 30 for lo
--- PASS: TestUpdateBorrowing (0.00s)
PASS
ok  	k8s.io/apiserver/pkg/util/flowcontrol	(cached)

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. area/apiserver cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants