mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #126222 from macsko/dont_lock_activeq_twice_in_activate_in_scheduling_queue
Don't lock activeQ twice when activating pod in scheduling queue
This commit is contained in:
commit
6f3f115378
@ -660,17 +660,12 @@ func (p *PriorityQueue) existsInActiveQ(pInfo *framework.QueuedPodInfo) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *PriorityQueue) activate(logger klog.Logger, pod *v1.Pod) bool {
|
func (p *PriorityQueue) activate(logger klog.Logger, pod *v1.Pod) bool {
|
||||||
// Verify if the pod is present in activeQ.
|
|
||||||
if p.existsInActiveQ(newQueuedPodInfoForLookup(pod)) {
|
|
||||||
// No need to activate if it's already present in activeQ.
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
var pInfo *framework.QueuedPodInfo
|
var pInfo *framework.QueuedPodInfo
|
||||||
// Verify if the pod is present in unschedulablePods or backoffQ.
|
// Verify if the pod is present in unschedulablePods or backoffQ.
|
||||||
if pInfo = p.unschedulablePods.get(pod); pInfo == nil {
|
if pInfo = p.unschedulablePods.get(pod); pInfo == nil {
|
||||||
// If the pod doesn't belong to unschedulablePods or backoffQ, don't activate it.
|
// If the pod doesn't belong to unschedulablePods or backoffQ, don't activate it.
|
||||||
|
// The pod can be already in activeQ.
|
||||||
if obj, exists, _ := p.podBackoffQ.Get(newQueuedPodInfoForLookup(pod)); !exists {
|
if obj, exists, _ := p.podBackoffQ.Get(newQueuedPodInfoForLookup(pod)); !exists {
|
||||||
logger.Error(nil, "To-activate pod does not exist in unschedulablePods or backoffQ", "pod", klog.KObj(pod))
|
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
pInfo = obj.(*framework.QueuedPodInfo)
|
pInfo = obj.(*framework.QueuedPodInfo)
|
||||||
|
Loading…
Reference in New Issue
Block a user