This is an automated email from the ASF dual-hosted git repository.

pbacsko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 5666fa2a [YUNIKORN-2633] Unnecessary warning from Partition when 
adding an application (#872)
5666fa2a is described below

commit 5666fa2a1e75ed302f3fe34b09dde81ab22fb7cf
Author: Peter Bacsko <[email protected]>
AuthorDate: Sun May 26 00:17:50 2024 +0200

    [YUNIKORN-2633] Unnecessary warning from Partition when adding an 
application (#872)
    
    Closes: #872
    
    Signed-off-by: Peter Bacsko <[email protected]>
---
 pkg/scheduler/partition.go | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/pkg/scheduler/partition.go b/pkg/scheduler/partition.go
index f2154136..11ee05ae 100644
--- a/pkg/scheduler/partition.go
+++ b/pkg/scheduler/partition.go
@@ -339,13 +339,18 @@ func (pc *PartitionContext) AddApplication(app 
*objects.Application) error {
                return fmt.Errorf("failed to find queue %s for application %s", 
queueName, appID)
        }
 
-       // set resources based on tags, but only if the queue is dynamic 
(unmanaged)
-       if queue.IsManaged() {
-               log.Log(log.SchedQueue).Warn("Trying to set resources on a 
queue that is not an unmanaged leaf",
-                       zap.String("queueName", queue.QueuePath))
-       } else {
-               queue.SetResources(app.GetGuaranteedResource(), 
app.GetMaxResource())
+       guaranteedRes := app.GetGuaranteedResource()
+       maxRes := app.GetMaxResource()
+       if guaranteedRes != nil || maxRes != nil {
+               // set resources based on tags, but only if the queue is 
dynamic (unmanaged)
+               if queue.IsManaged() {
+                       log.Log(log.SchedQueue).Warn("Trying to set resources 
on a queue that is not an unmanaged leaf",
+                               zap.String("queueName", queue.QueuePath))
+               } else {
+                       queue.SetResources(guaranteedRes, maxRes)
+               }
        }
+
        // check only for gang request
        // - make sure the taskgroup request fits in the maximum set for the 
queue hierarchy
        // - task groups should only be used in FIFO queues


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to