Achilleas Tzenetopoulos %!s(int64=5) %!d(string=hai) anos
pai
achega
04f1c641a7

+ 2 - 1
kubernetes-v1.15.4/pkg/scheduler/algorithm/priorities/custom_resource_allocation.go

@@ -127,6 +127,7 @@ func customResourceScorer(nodeName string) (float64, error) {
 
 	var results map[string]float64
 	// Check the cache
+	customcache.LabCache.Mux.Lock()
 	ipc, ok := customcache.LabCache.Cache[nodeName]["ipc"]
 	if !ok {
 		klog.Infof("IPC is nil")
@@ -143,7 +144,7 @@ func customResourceScorer(nodeName string) (float64, error) {
 	if !ok {
 		klog.Infof("C6 state is nil")
 	}
-
+	customcache.LabCache.Mux.Unlock()
 	// If the cache has value use it
 	if ipc != -1 && reads != -1 && writes != -1 && c6res != -1 {
 		results := map[string]float64{