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

narrow down the scope of EnqueueExtensions to subscribe less cluster events #121571

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

sanposhiho
Copy link
Member

@sanposhiho sanposhiho commented Oct 27, 2023

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Currently, we register default EventsToRegister for all plugins that don't have EnqueueExtension.
But, this PR changes it to register the default one only for PreEnqueue, PreFilter, Filter, Reserve, and Permit plugins. For other plugins, the scheduling framework doesn't register the default one.

EventsToRegister results in which events the scheduler watches, and when registered events come, the scheduling queue requeue Pods according to them. The queue checks the event can make Pod schedulable or not via QueueingHint from pInfo.UnschedulablePlugins/PendingPlugins.
Given this fact, plugins that never be registered in pInfo.UnschedulablePlugins don't need to have EventsToRegister.
And, currently, only PreEnqueue, PreFilter, Filter, Reserve, and Permit affect pInfo.UnschedulablePlugins/PendingPlugins.

Meaning all other plugins' EventsToRegister actually don't affect anything, and registering default EventsToRegister to other plugins might result in watching events in vain, which all of PreEnqueue, PreFilter, Filter, Reserve, and Permit plugins aren't interested in.

Which issue(s) this PR fixes:

Fixes #119783
Also help #120622 a bit by reducing the number of events the scheduler subscribes.

Special notes for your reviewer:

Does this PR introduce a user-facing change?

EnqueueExtensions from plugins other than PreEnqueue, PreFilter, Filter, Reserve and Permit are ignored.
It reduces the number of kinds of cluster events the scheduler needs to subscribe/handle.

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


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 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. labels Oct 27, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Oct 27, 2023
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 27, 2023
@sanposhiho
Copy link
Member Author

/cc @alculquicondor

/hold
This change is not a small one, and requires discussion with other approvers.

@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 Oct 27, 2023
Comment on lines +885 to +890
framework.CSINode: framework.All - framework.Delete,
framework.CSIDriver: framework.All - framework.Delete,
framework.CSIStorageCapacity: framework.All - framework.Delete,
framework.PersistentVolume: framework.All - framework.Delete,
framework.PersistentVolumeClaim: framework.All - framework.Delete,
framework.StorageClass: framework.All - framework.Delete,
Copy link
Member

Choose a reason for hiding this comment

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

I think this justifies a cherry-pick to 1.28

Copy link
Member

Choose a reason for hiding this comment

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

Please don't. It's more an optimization instead of essential bug fixes.

Copy link
Member

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

This could help with #120622

@alculquicondor
Copy link
Member

cc @Huang-Wei in case this could affect out-of-tree plugins

@Huang-Wei
Copy link
Member

cc @Huang-Wei in case this could affect out-of-tree plugins

LGTM. Some out-of-tree Score plugins are intentionally to leave EventsToRegister un-implemented.

@Huang-Wei
Copy link
Member

/retest

Copy link
Member

@Huang-Wei Huang-Wei 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 Oct 27, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e0ea4d15e782a3c5f2c1ee855880264b0676ff1a

@alculquicondor
Copy link
Member

/remove-kind cleanup
/kind bug

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Oct 27, 2023
@alculquicondor
Copy link
Member

/approve
/hold cancel

@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 Oct 27, 2023
@alculquicondor
Copy link
Member

FYI @aleksandra-malinowska

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, sanposhiho

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

@Huang-Wei
Copy link
Member

@alculquicondor it's not a bug fix actually.

/remove-kind bug
/kind cleanup

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed kind/bug Categorizes issue or PR as related to a bug. labels Oct 27, 2023
@k8s-ci-robot k8s-ci-robot merged commit 0957869 into kubernetes:master Oct 27, 2023
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Oct 27, 2023
framework.StorageClass: framework.All,
framework.PodSchedulingContext: framework.All,
},
want: map[framework.GVK]framework.ActionType{},
},
{
name: "plugins with default profile",
plugins: schedulerapi.PluginSet{Enabled: defaults.PluginsV1.MultiPoint.Enabled},
want: map[framework.GVK]framework.ActionType{
framework.Pod: framework.All,
framework.Node: framework.All,
Copy link
Member

Choose a reason for hiding this comment

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

which plugin cares about Node Delete?

Copy link
Member Author

Choose a reason for hiding this comment

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

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. 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. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scheduler: register default EventsToRegister in only some extension points
4 participants