Commit 8c836717 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #32643 from smarterclayton/scheduler_retry

Automatic merge from submit-queue Exit scheduler retry loop correctly The error was being eaten and shadowed, which means we would never exit this loop. This might lead to a goroutine in the scheduler being used forever without exiting at maximum backoff. Switched to use the real client to make later refactors easier. @wojtek-t this may lead to scheduler informer exhaustion - not that familiar with retries
parents 843d7cd2 4d79030b
......@@ -532,10 +532,13 @@ func (factory *ConfigFactory) makeDefaultErrorFunc(backoff *podBackoff, podQueue
return
}
// Get the pod again; it may have changed/been scheduled already.
pod = &api.Pod{}
getBackoff := initialGetBackoff
for {
if err := factory.Client.Get().Namespace(podID.Namespace).Resource("pods").Name(podID.Name).Do().Into(pod); err == nil {
pod, err := factory.Client.Pods(podID.Namespace).Get(podID.Name)
if err == nil {
if len(pod.Spec.NodeName) == 0 {
podQueue.AddIfNotPresent(pod)
}
break
}
if errors.IsNotFound(err) {
......@@ -548,9 +551,6 @@ func (factory *ConfigFactory) makeDefaultErrorFunc(backoff *podBackoff, podQueue
}
time.Sleep(getBackoff)
}
if pod.Spec.NodeName == "" {
podQueue.AddIfNotPresent(pod)
}
}()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment