pbacsko commented on a change in pull request #353:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/353#discussion_r778827750
##########
File path: pkg/scheduler/partition.go
##########
@@ -338,6 +338,32 @@ func (pc *PartitionContext) AddApplication(app
*objects.Application) error {
return fmt.Errorf("failed to find queue %s for application %s",
queueName, appID)
}
+ // Has user or group defined with any limits? If yes, Is there a room
to operate?
+ user := queue.GetUserGroupManager().GetUser(app.GetUser().User)
+ if user != nil {
+ if user.CanRun() {
+ user.IncRunningApplications()
+ } else {
+ return fmt.Errorf("user '%s' has reached max
applications limit in queue %s", app.GetUser().User,
+ queueName)
+ }
+ }
+
+ 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.CanRun() {
+ g.IncRunningApplications()
+ if user != nil {
+ user.SetUsedGroup(g.GetName())
Review comment:
What if the user belongs to multiple groups? Can that happen?
If so, is the list of groups predictable?
--
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]