mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 16:06:51 +00:00
feature(scheduling_queue): track events per Pods (#118438)
* feature(sscheduling_queue): track events per Pods * fix typos * record events in one slice and make each in-flight Pod to refer it * fix: use Pop() in test before AddUnschedulableIfNotPresent to register in-flight Pods * eliminate MakeNextPodFuncs * call Done inside the scheduling queue * fix comment * implement done() not to require lock in it * fix UTs * improve the receivedEvents implementation based on suggestions * call DonePod when we don't call AddUnschedulableIfNotPresent * fix UT * use queuehint to filter out events for in-flight Pods * fix based on suggestion from aldo * fix based on suggestion from Wei * rename lastEventBefore → previousEvent * fix based on suggestion * address comments from aldo * fix based on the suggestion from Abdullah * gate in-flight Pods logic by the SchedulingQueueHints feature gate
This commit is contained in:
@@ -71,7 +71,7 @@ type Scheduler struct {
|
||||
// is available. We don't use a channel for this, because scheduling
|
||||
// a pod may take some amount of time and we don't want pods to get
|
||||
// stale while they sit in a channel.
|
||||
NextPod func() *framework.QueuedPodInfo
|
||||
NextPod func() (*framework.QueuedPodInfo, error)
|
||||
|
||||
// FailureHandler is called upon a scheduling failure.
|
||||
FailureHandler FailureHandlerFn
|
||||
@@ -346,12 +346,12 @@ func New(ctx context.Context,
|
||||
nodeInfoSnapshot: snapshot,
|
||||
percentageOfNodesToScore: options.percentageOfNodesToScore,
|
||||
Extenders: extenders,
|
||||
NextPod: internalqueue.MakeNextPodFunc(logger, podQueue),
|
||||
StopEverything: stopEverything,
|
||||
SchedulingQueue: podQueue,
|
||||
Profiles: profiles,
|
||||
logger: logger,
|
||||
}
|
||||
sched.NextPod = podQueue.Pop
|
||||
sched.applyDefaultHandlers()
|
||||
|
||||
if err = addAllEventHandlers(sched, informerFactory, dynInformerFactory, unionedGVKs(queueingHintsPerProfile)); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user