wilfred-s commented on a change in pull request #108: [YUNIKORN-47] Support 
node update action

 File path: pkg/cache/partition_info.go
 @@ -477,12 +477,17 @@ func (pi *PartitionInfo) 
releaseAllocationsForApplication(toRelease *commonevent
        for _, alloc := range allocationsToRelease {
                // remove allocation from node
                node := pi.nodes[alloc.AllocationProto.NodeID]
+               // node could be nil if when release happens, the node is 
+               // removed from the cluster. in this case, we need to make sure
+               // resources are released correctly. otherwise these resources 
+               // be leaked.
                if node == nil || 
node.GetAllocation(alloc.AllocationProto.UUID) == nil {
-                       log.Logger().Info("node is not found for allocation",
-                               zap.Any("allocation", alloc))
-                       continue
+                       log.Logger().Info("node is not found or the allocation 
is not found",
+                               zap.String("node", 
+                               zap.String("allocationID", 
+               } else {
+                       node.RemoveAllocation(alloc.AllocationProto.UUID)
-               node.RemoveAllocation(alloc.AllocationProto.UUID)
 Review comment:
   This needs to be reverted too. If we have a nil node we need to continue. It 
is almost an error case but we can only update if we have a node and an alloc.
   The queue will get out of sync if we remove the alloc while the node is nil. 
The nil node is a result of the queue already being updated.
   After that I am OK with a merge

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.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

To unsubscribe, e-mail: dev-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: dev-h...@yunikorn.apache.org

Reply via email to