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

Automated cherry pick of #104833 (1.22): Refine locking in API Priority and Fairness config controller #105049

Conversation

shyamjvs
Copy link
Member

@shyamjvs shyamjvs commented Sep 15, 2021

Cherry pick of #104833 on release-1.22.

#104833: Refine locking in API Priority and Fairness config controller

For details on the cherry pick process, see the cherry pick requests page.

NONE

Instead of a plain `Mutex`, use an `RWMutex` so that the common
operations can proceed in parallel.
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone Sep 15, 2021
@k8s-ci-robot k8s-ci-robot added do-not-merge/cherry-pick-not-approved Indicates that a PR is not yet approved to merge into a release branch. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note-none Denotes a PR that doesn't merit a release note. area/apiserver and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Sep 15, 2021
@k8s-ci-robot k8s-ci-robot added 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 Sep 15, 2021
@shyamjvs
Copy link
Member Author

/kind bug
/sig api-machinery
/priority important-soon

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 15, 2021
@shyamjvs shyamjvs changed the title Automated cherry pick of #104833: Refine locking in API Priority and Fairness config controller Automated cherry pick of #104833 (1.22): Refine locking in API Priority and Fairness config controller Sep 15, 2021
Comment on lines +135 to +136
// watchTracker implements the necessary WatchTracker interface.
WatchTracker
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was wrongly added with the rebase, lemme fix it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, ignore above comment. I was looking at the cherrypick for older versions 1.21 and 1.20.

@shyamjvs
Copy link
Member Author

/test pull-kubernetes-integration

@MikeSpreitzer
Copy link
Member

@MikeSpreitzer

Copy link
Member

@MikeSpreitzer MikeSpreitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/LGTM

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MikeSpreitzer, shyamjvs

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 Sep 16, 2021
@MikeSpreitzer
Copy link
Member

@shyamjvs : thanks for doing this

@MikeSpreitzer
Copy link
Member

Release managers note: we are proposing to cherry-pick this because it significantly reduces the lock contention in one of the request filters in the apiserver, thus making a performance improvement for all requests.

@shyamjvs
Copy link
Member Author

@savitharaghunathan Given you were the release manager for 1.22, could you help approve this cherrypick?

@caesarxuchao
Copy link
Member

/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 Sep 16, 2021
@puerco
Copy link
Member

puerco commented Sep 17, 2021

Thank you for the cherry picks @shyamjvs !
When filing cherry picks, be sure to ping the @kubernetes/release-managers group instead of the release leads. The release leads are not release managers and cannot approve the cherry-picks :)
/lgtm

@puerco puerco added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Sep 17, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/cherry-pick-not-approved Indicates that a PR is not yet approved to merge into a release branch. label Sep 17, 2021
@MikeSpreitzer
Copy link
Member

MikeSpreitzer commented Sep 17, 2021

Why is tide not responding? Let's prod it.
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 17, 2021
@MikeSpreitzer
Copy link
Member

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 17, 2021
@k8s-ci-robot k8s-ci-robot merged commit f3495a8 into kubernetes:release-1.22 Sep 17, 2021
@shyamjvs shyamjvs deleted the automated-cherry-pick-of-#104833-upstream-release-1.22 branch September 17, 2021 20:04
cfgCtlr.lock.Lock()
defer cfgCtlr.lock.Unlock()
cfgCtlr.lock.RLock()
defer cfgCtlr.lock.RUnlock()
for _, plc := range cfgCtlr.priorityLevelStates {
if plc.queues != nil {
plc.queues.UpdateObservations()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it correct that we're calling UpdateObservations() under a read lock?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. See the writes into the observers are not what's covered by the write locking here.

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 cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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/M Denotes a PR that changes 30-99 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

6 participants