manirajv06 commented on code in PR #1043:
URL: https://github.com/apache/yunikorn-k8shim/pull/1043#discussion_r3880298888


##########
pkg/cache/context.go:
##########
@@ -706,9 +745,13 @@ func (ctx *Context) IsPodFitNode(name, node string, 
allocate bool) error {
                return ErrorNodeNotFound
        }
        // need to lock cache here as predicates need a stable view into the 
cache
-       ctx.schedulerCache.LockForReads()
-       defer ctx.schedulerCache.UnlockForReads()
-       plugin, err := ctx.predManager.Predicates(pod, targetNode, allocate)
+       ctx.schedulerCache.LockForWrites()
+       defer ctx.schedulerCache.UnlockForWrites()
+       cycleState := ctx.schedulerCache.GetCycleState(pod)

Review Comment:
   Yes, read lock is enough. Also taken care of write locks in other places too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to