Update expiration timeout based on observed latencies

This commit is contained in:
Prashanth Balasubramanian
2015-04-30 10:58:18 -07:00
parent dc137a47eb
commit a8fdf3d78b
3 changed files with 32 additions and 12 deletions

View File

@@ -18,6 +18,7 @@ package cache
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/golang/glog"
"time"
)
@@ -81,6 +82,7 @@ func (c *ExpirationCache) getOrExpire(key string) (interface{}, bool) {
return nil, false
}
if c.expirationPolicy.IsExpired(timestampedItem) {
glog.V(4).Infof("Entry %v: %+v has expired", key, timestampedItem.obj)
// Since expiration happens lazily on read, don't hold up
// the reader trying to acquire a write lock for the delete.
// The next reader will retry the delete even if this one