diff --git a/pkg/scheduler/internal/queue/scheduling_queue.go b/pkg/scheduler/internal/queue/scheduling_queue.go index 56504cf77b5..65c7b757159 100644 --- a/pkg/scheduler/internal/queue/scheduling_queue.go +++ b/pkg/scheduler/internal/queue/scheduling_queue.go @@ -302,14 +302,15 @@ 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)) } if _, exists, _ := p.podBackoffQ.Get(pInfo); exists { 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.