wilfred-s commented on code in PR #824:
URL: https://github.com/apache/yunikorn-k8shim/pull/824#discussion_r1576604950


##########
pkg/cache/context.go:
##########
@@ -633,21 +639,28 @@ func (ctx *Context) EventsToRegister(queueingHintFn 
framework.QueueingHintFn) []
        return ctx.predManager.EventsToRegister(queueingHintFn)
 }
 
-// evaluate given predicates based on current context
+// IsPodFitNode evaluates given predicates based on current context
 func (ctx *Context) IsPodFitNode(name, node string, allocate bool) error {
        ctx.lock.RLock()
        defer ctx.lock.RUnlock()
-       if pod, ok := ctx.schedulerCache.GetPod(name); ok {
-               // if pod exists in cache, try to run predicates
-               if targetNode := ctx.schedulerCache.GetNode(node); targetNode 
!= nil {
-                       // need to lock cache here as predicates need a stable 
view into the cache
-                       ctx.schedulerCache.LockForReads()
-                       defer ctx.schedulerCache.UnlockForReads()
-                       _, err := ctx.predManager.Predicates(pod, targetNode, 
allocate)
-                       return err
-               }
+       var pod *v1.Pod
+       var ok bool
+       if pod, ok = ctx.schedulerCache.GetPod(name); !ok {

Review Comment:
   Logged [YUNIKORN-2578](https://issues.apache.org/jira/browse/YUNIKORN-2578) 
for that as I noticed the same. Also logged 
[YUNIKORN-2577](https://issues.apache.org/jira/browse/YUNIKORN-2577) to clean 
up the IsPodFitNodeViaPreemption function



-- 
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