Added code for disable scheduler cache expiry

This commit is contained in:
Kapil Jain 2022-07-02 13:31:22 +05:30
parent 89aaf7c02d
commit 4706dda5da
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.