craigcondit commented on code in PR #734:
URL: https://github.com/apache/yunikorn-k8shim/pull/734#discussion_r1441983426


##########
pkg/cache/context.go:
##########
@@ -48,17 +52,19 @@ import (
        "github.com/apache/yunikorn-scheduler-interface/lib/go/si"
 )
 
+const registerNodeContextHandler = "RegisterNodeContextHandler"
+
 // context maintains scheduling state, like apps and apps' tasks.
 type Context struct {
        applications   map[string]*Application        // apps
-       nodes          *schedulerNodes                // nodes
        schedulerCache *schedulercache.SchedulerCache // external cache
        apiProvider    client.APIProvider             // apis to interact with 
api-server, scheduler-core, etc
        predManager    predicates.PredicateManager    // K8s predicates
        pluginMode     bool                           // true if we are 
configured as a scheduler plugin
        namespace      string                         // yunikorn namespace
        configMaps     []*v1.ConfigMap                // cached yunikorn 
configmaps
        lock           *sync.RWMutex                  // lock
+       txnID          atomic.Uint64                  // transaction ID counter

Review Comment:
   Actually, that's a bug. It's meant to ensure that each handler is unique in 
case there are multiple nodes in progress. the `txnID.Load()` call should be 
`txnID.Add(1)`. Will update in next commit.



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