fix: take QHint disable scenario into consideration

This commit is contained in:
Kensei Nakada
2024-11-06 18:28:13 +09:00
parent 4b92f6d398
commit 49135d6173

View File

@@ -417,12 +417,10 @@ func (p *PriorityQueue) isPodWorthRequeuing(logger klog.Logger, pInfo *framework
// that indicates that the event wants to be effective for the Pod only.
// Specifically, EventForceActivate could have a target Pod in newObj.
if newObj != nil {
if pod, ok := newObj.(*v1.Pod); ok && pod.UID == pInfo.Pod.UID {
logger.V(6).Info("Worth requeuing because the event is wildcard", "pod", klog.KObj(pInfo.Pod))
return queueAfterBackoff
if pod, ok := newObj.(*v1.Pod); !ok || pod.UID != pInfo.Pod.UID {
// This wildcard event is not for this Pod.
return queueSkip
}
// This wildcard event is not for this Pod.
return queueSkip
}
// If the wildcard event is special one as someone wants to force all Pods to move to activeQ/backoffQ.
@@ -620,10 +618,11 @@ func (p *PriorityQueue) Activate(logger klog.Logger, pods map[string]*v1.Pod) {
continue
}
// If this pod is in-flight, register the activation event so that the pod will be requeued when it comes back.
// If this pod is in-flight, register the activation event or update moveRequestCycle so that the pod will be requeued when it comes back.
// Specifically in the in-tree plugins, this is for the scenario with the preemption plugin
// where the async preemption API calls are all done or fail at some point before the Pod comes back to the queue.
p.activeQ.addEventsIfPodInFlight(nil, pod, []framework.ClusterEvent{framework.EventForceActivate})
p.moveRequestCycle = p.activeQ.schedulingCycle()
}
if activated {