mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Refresh Timestamp when pod is not present in the three sub-queues
The pInfo.Timestamp is refreshed but the sort in activeQ or podBackoffQ is not be updated when pod is already present in the backoff or active queue. AddUnschedulableIfNotPresent() return error if pod is already present in the backoff or active queue, and there is no re-add. So refresh pInfo.Timestamp when the pod is not present in the three sub-queues, otherwise need to update the order of the pod in the active or backoff queue, for example p.activeQ.Update(pInfo)
This commit is contained in:
parent
bd4d197b52
commit
5e6177897d
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user