wilfred-s commented on code in PR #1043:
URL: https://github.com/apache/yunikorn-k8shim/pull/1043#discussion_r3879151509
##########
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:
Something to still think about. The `CycleState` can be accessed
concurrently. A read lock on the cache should be enough as a cycle state must
exist and multiple filters can write into it if needed.
--
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]