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/10/21 12:44:54 UTC

[GitHub] [incubator-yunikorn-core] pbacsko commented on a change in pull request #330: [YUNIKORN-879] Extend health check with allocation check

pbacsko commented on a change in pull request #330:
URL: https://github.com/apache/incubator-yunikorn-core/pull/330#discussion_r733637210



##########
File path: pkg/scheduler/health_checker.go
##########
@@ -151,5 +161,40 @@ func checkSchedulingContext(schedulerContext *ClusterContext) []dao.HealthCheckI
 	infos[6] = CreateCheckInfo(true, "Reservation check",
 		"Check the reservation nr compared to the number of nodes",
 		fmt.Sprintf("Reservation/node nr ratio: %f", partitionReservationRatio))
+	infos[7] = CreateCheckInfo(len(orphanAllocationsOnNode) == 0, "Orphan allocation on node check",
+		"Check if there are orphan allocations on the nodes",
+		fmt.Sprintf("Orphan allocations: %v", orphanAllocationsOnNode))
+	infos[8] = CreateCheckInfo(len(orphanAllocationsOnApp) == 0, "Orphan allocation on app check",
+		"Check if there are orphan allocations on the applications",
+		fmt.Sprintf("OrphanAllocations: %v", orphanAllocationsOnApp))
 	return infos
 }
+
+func checkAppAllocations(app *objects.Application, nodes objects.NodeCollection) []*objects.Allocation {
+	orphanAllocationsOnApp := make([]*objects.Allocation, 0)
+	for _, alloc := range app.GetAllAllocations() {
+		if node := nodes.GetNode(alloc.NodeID); node != nil {
+			node.GetAllocation(alloc.UUID)

Review comment:
       Is this line necessary?




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