diff --git a/pkg/scheduler/internal/queue/scheduling_queue.go b/pkg/scheduler/internal/queue/scheduling_queue.go index 56504cf77b5..4050392eb76 100644 --- a/pkg/scheduler/internal/queue/scheduling_queue.go +++ b/pkg/scheduler/internal/queue/scheduling_queue.go @@ -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 {