Merge pull request #97302 from jindezgm/patch-1

Refresh Timestamp when pod is not present in the three sub-queues
This commit is contained in:
Kubernetes Prow Robot 2020-12-22 07:52:26 -08:00 committed by GitHub
commit 8c6f244c18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -302,8 +302,6 @@ func (p *PriorityQueue) AddUnschedulableIfNotPresent(pInfo *framework.QueuedPodI
return fmt.Errorf("pod: %v is already present in unschedulable queue", nsNameForPod(pod))
}
// Refresh the timestamp since the pod is re-added.
pInfo.Timestamp = p.clock.Now()
if _, exists, _ := p.activeQ.Get(pInfo); exists {
return fmt.Errorf("pod: %v is already present in the active queue", nsNameForPod(pod))
}
@ -311,6 +309,9 @@ func (p *PriorityQueue) AddUnschedulableIfNotPresent(pInfo *framework.QueuedPodI
return fmt.Errorf("pod %v is already present in the backoff queue", nsNameForPod(pod))
}
// Refresh the timestamp since the pod is re-added.
pInfo.Timestamp = p.clock.Now()
// If a move request has been received, move it to the BackoffQ, otherwise move
// it to unschedulableQ.
if p.moveRequestCycle >= podSchedulingCycle {