From 45ebe123f4106880b8a72740cc006bb697fcda51 Mon Sep 17 00:00:00 2001 From: steinsgateted Date: Sun, 6 Mar 2022 12:23:23 +0800 Subject: [PATCH] [YUNIKORN-1093] Track rejected applications --- pkg/scheduler/context.go | 3 +-- pkg/scheduler/partition.go | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/scheduler/context.go b/pkg/scheduler/context.go index e093d537a..919a4b1b9 100644 --- a/pkg/scheduler/context.go +++ b/pkg/scheduler/context.go @@ -519,8 +519,7 @@ func (cc *ClusterContext) handleRMUpdateApplicationEvent(event *rmevent.RMUpdate ApplicationID: app.ApplicationID, Reason: err.Error(), }) - rejectedApp := objects.NewApplication(app, ugi, cc.rmEventHandler, request.RmID) - partition.addRejectedApplication(rejectedApp, err.Error()) + partition.addRejectedApplication(schedApp, err.Error()) log.Logger().Error("Failed to add application to partition (placement rejected)", zap.String("applicationID", app.ApplicationID), diff --git a/pkg/scheduler/partition.go b/pkg/scheduler/partition.go index 9f90a6ea3..ac34931a6 100644 --- a/pkg/scheduler/partition.go +++ b/pkg/scheduler/partition.go @@ -1118,6 +1118,7 @@ func (pc *PartitionContext) GetAppsByState(state string) []*objects.Application return appList } +// used to find expired apps in rejected applications func (pc *PartitionContext) GetRejectedAppsByState(state string) []*objects.Application { pc.RLock() defer pc.RUnlock()