Fix local cluster leaking memory.

Local cluster is leaking memory due to mutation detector being enabled.
In addition there is no warning in the logs that this could be the
issue.
Added a log warning when this feature is enabled to make debugging this
issue easier for other cases of this.
Fixed import ordering as per @liggitt

Kubernetes-commit: 07ba609b50d6f00c52acbfd6eaa43e6b527c5c2d
This commit is contained in:
Walter Fender 2018-03-06 13:03:30 -08:00 committed by Kubernetes Publisher
parent 4f2b10cdd3
commit cafb570f17

View File

@ -24,6 +24,8 @@ import (
"sync"
"time"
"github.com/golang/glog"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/diff"
)
@ -43,6 +45,7 @@ func NewCacheMutationDetector(name string) CacheMutationDetector {
if !mutationDetectionEnabled {
return dummyMutationDetector{}
}
glog.Warningln("Mutation detector is enabled, this will result in memory leakage.")
return &defaultCacheMutationDetector{name: name, period: 1 * time.Second}
}