kingamarton commented on a change in pull request #330:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/330#discussion_r734370778
##########
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)
+ if node.GetAllocation(alloc.UUID) == nil {
Review comment:
If I will handle it together I will have to add a check in the else
statement to see if the node is nil or the allocation is found on the node. In
this second case we have a valid allocation, not an orphan one, but in the
first case when the node is nil, we will have an orphan one.
--
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]