yunikorn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [incubator-yunikorn-core] wilfred-s commented on a change in pull request #108: [YUNIKORN-47] Support node update action
Date Thu, 26 Mar 2020 05:33:31 GMT
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
 	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 already
+		// removed from the cluster. in this case, we need to make sure
+		// resources are released correctly. otherwise these resources will
+		// 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", alloc.AllocationProto.NodeID),
+				zap.String("allocationID", alloc.AllocationProto.UUID))
+		} 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:
For additional commands, e-mail:

View raw message