You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2022/01/12 16:44:37 UTC

[GitHub] [incubator-yunikorn-k8shim] craigcondit commented on a change in pull request #336: [YUNIKORN-971] Implement YuniKorn as a Kubernetes scheduler plugin.

craigcondit commented on a change in pull request #336:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/336#discussion_r783255792



##########
File path: pkg/cache/external/scheduler_cache.go
##########
@@ -36,23 +36,23 @@ import (
 // nodes are cached in the form of de-scheduler nodeInfo, instead of re-creating all nodes info from scratch,
 // we replicate nodes info from de-scheduler, in order to re-use predicates functions.
 type SchedulerCache struct {
-	// node name to NodeInfo map
-	nodesMap map[string]*framework.NodeInfo
-	podsMap  map[string]*v1.Pod
-	// this is a map of assumed pods,
-	// the value indicates if a pod volumes are all bound
-	assumedPods map[string]bool
-	lock        sync.RWMutex
-	// client APIs
-	clients *client.Clients
+	nodesMap              map[string]*framework.NodeInfo // node name to NodeInfo map
+	podsMap               map[string]*v1.Pod
+	assumedPods           map[string]bool   // map of assumed pods, value indicates if pod volumes are all bound
+	pendingAllocations    map[string]string // map of pod to node ID, presence indicates a pending allocation for scheduler
+	inProgressAllocations map[string]string // map of pod to node ID, presence indicates an in-process allocation for scheduler

Review comment:
       A pending allocation is one which YuniKorn has decided on, but which has not yet been communicated to the default scheduler via the scheduling framework (the PreFilter()/Filter() calls in the plugin). An in-progress allocation is one which HAS been communicated to the default scheduler via PreFilter() / Filter() but which we have not yet got confirmation of the Pod being bound (PostBind() in the plugin has not yet been called). This is used to track state to ensure that we don't reprocess the same Pod or leak in the case where the default scheduler is unable to bind the pod for some reason.




-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org