Count ttl for assumed pod when binding is finished
In such cases when api server is overloaded and returns a lot of 429 (too many requests) errors - binding may take a lot of time to succeed due to retry policy implemented in rest client. In such events cache ttl for assumed pods wasn't big enough. In order to minimize probability of such errors ttl for assumed pods will be counted from the time when binding for particular pod is finished (either with error or success) Change-Id: Ib0122f8a76dc57c82f2c7c52497aad1bdd8be411
This commit is contained in:
@@ -138,6 +138,9 @@ func (s *Scheduler) scheduleOne() {
|
||||
// If binding succeeded then PodScheduled condition will be updated in apiserver so that
|
||||
// it's atomic with setting host.
|
||||
err := s.config.Binder.Bind(b)
|
||||
if err := s.config.SchedulerCache.FinishBinding(&assumed); err != nil {
|
||||
glog.Errorf("scheduler cache FinishBinding failed: %v", err)
|
||||
}
|
||||
if err != nil {
|
||||
glog.V(1).Infof("Failed to bind pod: %v/%v", pod.Namespace, pod.Name)
|
||||
if err := s.config.SchedulerCache.ForgetPod(&assumed); err != nil {
|
||||
|
Reference in New Issue
Block a user