manirajv06 commented on a change in pull request #353:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/353#discussion_r780894815
##########
File path: pkg/scheduler/partition.go
##########
@@ -380,7 +406,33 @@ func (pc *PartitionContext) removeApplication(appID
string) []*objects.Allocatio
// Remove app from queue
if queue := app.GetQueue(); queue != nil {
queue.RemoveApplication(app)
+
+ var updateGroupMetrics bool
+ if len(app.GetUser().User) > 0 {
+ user :=
queue.GetUserGroupManager().GetUser(app.GetUser().User)
+ if user != nil {
+ user.DecRunningApplications()
+ g :=
queue.GetUserGroupManager().GetGroup(user.GetUsedGroup())
+ if g != nil {
+ g.DecRunningApplications()
+ updateGroupMetrics = true
+ }
+ }
+ }
+
+ // Used when limit has been configured only for group, not for
individual user
+ if ! updateGroupMetrics && len(app.GetUser().User) > 0 {
+ for _, group := range app.GetUser().Groups {
+ // Is there any group (to which user belongs
to) config has limit settings?
+ g := queue.GetUserGroupManager().GetGroup(group)
+ if g != nil {
+ g.DecRunningApplications()
+ break
Review comment:
> We need to store this information somewhere else, probably adding an
extra field to Application and not relying on app.GetUser().Groups.
Please see my earlier comment
https://github.com/apache/incubator-yunikorn-core/pull/353#discussion_r780043936.
user.SetUsedGroup() precisely takes care of this issue only.
--
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]