Merge pull request #110925 from kapiljain1989/remove_scheduler_cache_ttl

Remove TTL for scheduler cache to resolve the race condition when Cac…
This commit is contained in:
Kubernetes Prow Robot 2022-07-04 12:47:23 -07:00 committed by GitHub
commit 47ad357c52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -750,7 +750,7 @@ func (cache *cacheImpl) cleanupAssumedPods(now time.Time) {
"pod", klog.KObj(ps.pod)) "pod", klog.KObj(ps.pod))
continue continue
} }
if now.After(*ps.deadline) { if cache.ttl != 0 && now.After(*ps.deadline) {
klog.InfoS("Pod expired", "pod", klog.KObj(ps.pod)) klog.InfoS("Pod expired", "pod", klog.KObj(ps.pod))
if err := cache.removePod(ps.pod); err != nil { if err := cache.removePod(ps.pod); err != nil {
klog.ErrorS(err, "ExpirePod failed", "pod", klog.KObj(ps.pod)) klog.ErrorS(err, "ExpirePod failed", "pod", klog.KObj(ps.pod))

View File

@ -53,7 +53,7 @@ import (
const ( const (
// Duration the scheduler will wait before expiring an assumed pod. // Duration the scheduler will wait before expiring an assumed pod.
// See issue #106361 for more details about this parameter and its value. // See issue #106361 for more details about this parameter and its value.
durationToExpireAssumedPod = 15 * time.Minute durationToExpireAssumedPod = 0 * time.Minute
) )
// ErrNoNodesAvailable is used to describe the error that no nodes available to schedule pods. // ErrNoNodesAvailable is used to describe the error that no nodes available to schedule pods.