zhuqi-lucas commented on code in PR #927:
URL: https://github.com/apache/yunikorn-core/pull/927#discussion_r1713188454


##########
pkg/scheduler/objects/queue.go:
##########
@@ -388,11 +388,12 @@ func (sq *Queue) setResourcesFromConf(resource 
configs.Resources) error {
                return err
        }
 
-       sq.setResources(guaranteedResource, maxResource)
+       //nolint:godox //TODO, do we support setting maxApps for static queue?
+       sq.setResources(guaranteedResource, maxResource, "")
        return nil
 }
 
-func (sq *Queue) setResources(guaranteedResource, maxResource 
*resources.Resource) {
+func (sq *Queue) setResources(guaranteedResource, maxResource 
*resources.Resource, maxApps string) {

Review Comment:
   Addressed it in latest PR, thanks @wilfred-s for review.



##########
pkg/scheduler/objects/queue.go:
##########
@@ -444,12 +445,25 @@ func (sq *Queue) setResources(guaranteedResource, 
maxResource *resources.Resourc
                log.Log(log.SchedQueue).Debug("guaranteed resources setting 
ignored: cannot set zero guaranteed resources",
                        zap.String("queue", sq.QueuePath))
        }
+
+       // For shim side we already make sure the max apps > 0 and valid parsing
+       maxAppsInt, err := strconv.ParseInt(maxApps, 10, 64)
+       maxAppsUint := uint64(maxAppsInt)
+       if err == nil {
+               log.Log(log.SchedQueue).Debug("setting max running apps",
+                       zap.String("queue", sq.QueuePath),
+                       zap.Uint64("current", sq.maxRunningApps),
+                       zap.Uint64("new", maxAppsUint))
+       }
+       sq.maxRunningApps = maxAppsUint
+
+       //nolint:godox //TODO, we need max apps metrics and event change?
 }
 
-func (sq *Queue) SetResources(guaranteedResource, maxResource 
*resources.Resource) {
+func (sq *Queue) SetResources(guaranteedResource, maxResource 
*resources.Resource, maxApps string) {

Review Comment:
   Addressed it in latest PR, thanks @wilfred-s for review.



##########
pkg/scheduler/partition.go:
##########
@@ -342,13 +342,14 @@ func (pc *PartitionContext) AddApplication(app 
*objects.Application) error {
 
        guaranteedRes := app.GetGuaranteedResource()
        maxRes := app.GetMaxResource()
-       if !isRecoveryQueue && (guaranteedRes != nil || maxRes != nil) {
+       maxApps := app.GetMaxApps()

Review Comment:
   Addressed it in latest PR, thanks @wilfred-s for review.



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

Reply via email to