mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
fix: register the event in in-flight as necessary at Activate
This commit is contained in:
parent
8be51d3f32
commit
02459ca59c
@ -92,9 +92,11 @@ type PreEnqueueCheck func(pod *v1.Pod) bool
|
|||||||
type SchedulingQueue interface {
|
type SchedulingQueue interface {
|
||||||
framework.PodNominator
|
framework.PodNominator
|
||||||
Add(logger klog.Logger, pod *v1.Pod)
|
Add(logger klog.Logger, pod *v1.Pod)
|
||||||
// Activate moves the given pods to activeQ iff they're in unschedulablePods or backoffQ.
|
// Activate moves the given pods to activeQ.
|
||||||
// The passed-in pods are originally compiled from plugins that want to activate Pods,
|
// If a pod isn't found in unschedulablePods or backoffQ and it's in-flight,
|
||||||
// by injecting the pods through a reserved CycleState struct (PodsToActivate).
|
// the wildcard event is registered so that the pod will be requeued when it comes back.
|
||||||
|
// But, if a pod isn't found in unschedulablePods or backoffQ and it's not in-flight (i.e., completely unknown pod),
|
||||||
|
// Activate would ignore the pod.
|
||||||
Activate(logger klog.Logger, pods map[string]*v1.Pod)
|
Activate(logger klog.Logger, pods map[string]*v1.Pod)
|
||||||
// AddUnschedulableIfNotPresent adds an unschedulable pod back to scheduling queue.
|
// AddUnschedulableIfNotPresent adds an unschedulable pod back to scheduling queue.
|
||||||
// The podSchedulingCycle represents the current scheduling cycle number which can be
|
// The podSchedulingCycle represents the current scheduling cycle number which can be
|
||||||
@ -590,7 +592,11 @@ func (p *PriorityQueue) Add(logger klog.Logger, pod *v1.Pod) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activate moves the given pods to activeQ iff they're in unschedulablePods or backoffQ.
|
// Activate moves the given pods to activeQ.
|
||||||
|
// If a pod isn't found in unschedulablePods or backoffQ and it's in-flight,
|
||||||
|
// the wildcard event is registered so that the pod will be requeued when it comes back.
|
||||||
|
// But, if a pod isn't found in unschedulablePods or backoffQ and it's not in-flight (i.e., completely unknown pod),
|
||||||
|
// Activate would ignore the pod.
|
||||||
func (p *PriorityQueue) Activate(logger klog.Logger, pods map[string]*v1.Pod) {
|
func (p *PriorityQueue) Activate(logger klog.Logger, pods map[string]*v1.Pod) {
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
defer p.lock.Unlock()
|
defer p.lock.Unlock()
|
||||||
@ -599,7 +605,11 @@ func (p *PriorityQueue) Activate(logger klog.Logger, pods map[string]*v1.Pod) {
|
|||||||
for _, pod := range pods {
|
for _, pod := range pods {
|
||||||
if p.activate(logger, pod) {
|
if p.activate(logger, pod) {
|
||||||
activated = true
|
activated = true
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If this pod is in-flight, register the activation event so that the pod will be requeued when it comes back.
|
||||||
|
p.activeQ.addEventsIfPodInFlight(nil, pod, []framework.ClusterEvent{framework.EventForceActivate})
|
||||||
}
|
}
|
||||||
|
|
||||||
if activated {
|
if activated {
|
||||||
|
Loading…
Reference in New Issue
Block a user