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

apf: use EventClock for queueset #103829

Merged
merged 1 commit into from
Aug 6, 2021

Conversation

tkashem
Copy link
Contributor

@tkashem tkashem commented Jul 21, 2021

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

apf: use EventClock for queueset, this paves the way for writing unit tests for #103240

Which issue(s) this PR fixes:

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.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. 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. labels Jul 21, 2021
@k8s-ci-robot k8s-ci-robot added area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. 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. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 21, 2021
@tkashem
Copy link
Contributor Author

tkashem commented Jul 21, 2021

/assign @MikeSpreitzer @wojtek-t

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.

This fundamentally breaks the FakeEventClock. By extending FakeEventClock with methods that synchronize via channels rather than event functions, it lets client code have active goroutines that FakeEventClock::Run does not wait for. That means that all the test funcs built on FakeEventClock::Run do not properly exercise the code under test (if that code uses the added methods of FakeEventClock).

@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 Jul 22, 2021
@wojtek-t
Copy link
Member

@tkashem - I think we can close it in favor of @MikeSpreitzer PR.

@tkashem tkashem changed the title apf: use clock.Clock for queueset apf: use EventClock for queueset Jul 23, 2021
@tkashem
Copy link
Contributor Author

tkashem commented Jul 23, 2021

waiting for #103830 to merge, then I will use EventClock for queueset.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 3, 2021
@tkashem tkashem force-pushed the apf-queueset-clock branch 2 times, most recently from a717587 to 797b435 Compare August 3, 2021 17:16
@MikeSpreitzer
Copy link
Member

This is not based on the latest rev of #103830 . Other than that, looks OK.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 5, 2021
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 5, 2021
@tkashem
Copy link
Contributor Author

tkashem commented Aug 5, 2021

rebase completed

@MikeSpreitzer

fqs "k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset"
"k8s.io/apiserver/pkg/util/flowcontrol/metrics"
kubeinformers "k8s.io/client-go/informers"
"k8s.io/klog/v2"
utilclock "k8s.io/utils/clock"
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't bother to rename this import, let it be known as "clock". We are trying to move everything that was using k8s.io/apimachinery/pkg/util/clock to k8s.io/utils/clock so that we can retire k8s.io/apimachinery/pkg/util/clock.

Copy link
Contributor Author

@tkashem tkashem Aug 5, 2021

Choose a reason for hiding this comment

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

we have two clock packages being used here - fairqueuing and utils, so the prefix makes it more explicit, but i am fine either way.

Copy link
Member

Choose a reason for hiding this comment

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

k8s.io/utils/clock is the base clock package. k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/clock builds on that, adding EventClock. Now that I think of it, it would be better if the latter were k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MikeSpreitzer yes, i agree, eventclock is a better name - can we merge this PR? I am happy to open a separate PR with the rename.

Copy link
Member

Choose a reason for hiding this comment

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

Mike already have one opened.

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.

Looks OK except for the import name.

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 Aug 6, 2021
@wojtek-t
Copy link
Member

wojtek-t commented Aug 6, 2021

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MikeSpreitzer, tkashem, wojtek-t

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 Aug 6, 2021
@tkashem
Copy link
Contributor Author

tkashem commented Aug 6, 2021

/test pull-kubernetes-integration

@k8s-ci-robot k8s-ci-robot merged commit 641eeb5 into kubernetes:master Aug 6, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Aug 6, 2021
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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/S Denotes a PR that changes 10-29 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

5 participants