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 2021/02/10 12:51:46 UTC

[GitHub] [incubator-yunikorn-core] kingamarton commented on a change in pull request #245: [YUNIKORN-519] Cleanup placeholders when the app is Completed

kingamarton commented on a change in pull request #245:
URL: https://github.com/apache/incubator-yunikorn-core/pull/245#discussion_r573701820



##########
File path: pkg/scheduler/partition.go
##########
@@ -1207,6 +1207,25 @@ func (pc *PartitionContext) cleanupExpiredApps() {
 	}
 }
 
+func (pc *PartitionContext) cleanupPlaceholders() []*objects.Allocation {
+	var released []*objects.Allocation
+	for _, app := range pc.GetAppsByState(objects.Completed.String()) {
+		// at this point if we still have allocations those are placeholders
+		for _, alloc := range app.GetAllAllocations() {
+			r, _ := pc.removeAllocation(&si.AllocationRelease{
+				PartitionName:   pc.Name,
+				ApplicationID:   app.ApplicationID,
+				UUID:            alloc.UUID,
+				TerminationType: si.AllocationRelease_TIMEOUT,
+			})
+			released = append(released, r...)
+		}

Review comment:
       If we just simply call app.RemoveAllAllocations, then the allocations won't de deleted from the node, just from the application




----------------------------------------------------------------
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:
users@infra.apache.org