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

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


The following commit(s) were added to refs/heads/branch-1.5 by this push:
     new bb07ef0d [YUNIKORN-2642] Don't set resources on the recovery queue 
(#879)
bb07ef0d is described below

commit bb07ef0d22b4067539ac4d2db8a15f1bd031b40c
Author: pbacsko <[email protected]>
AuthorDate: Thu May 30 09:46:23 2024 +0200

    [YUNIKORN-2642] Don't set resources on the recovery queue (#879)
---
 pkg/scheduler/objects/queue.go  |  5 +++++
 pkg/scheduler/partition_test.go | 16 ++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/pkg/scheduler/objects/queue.go b/pkg/scheduler/objects/queue.go
index 84d9d7b5..a5edece5 100644
--- a/pkg/scheduler/objects/queue.go
+++ b/pkg/scheduler/objects/queue.go
@@ -729,6 +729,11 @@ func (sq *Queue) AddApplication(app *Application) {
        appID := app.ApplicationID
        sq.applications[appID] = app
        sq.queueEvents.sendNewApplicationEvent(sq.QueuePath, appID)
+       if common.IsRecoveryQueue(sq.QueuePath) {
+               // don't set tag-based resources on the recovery queue
+               return
+       }
+
        // YUNIKORN-199: update the quota from the namespace
        // get the tag with the quota
        quota := app.GetTag(siCommon.AppTagNamespaceResourceQuota)
diff --git a/pkg/scheduler/partition_test.go b/pkg/scheduler/partition_test.go
index 5a275c0e..bd1b5900 100644
--- a/pkg/scheduler/partition_test.go
+++ b/pkg/scheduler/partition_test.go
@@ -979,6 +979,22 @@ func TestAddAppForced(t *testing.T) {
        assert.Equal(t, common.RecoveryQueueFull, partApp3.GetQueuePath(), 
"wrong queue path for app3")
        assert.Check(t, recoveryQueue == partApp3.GetQueue(), "wrong queue for 
app3")
        assert.Equal(t, 3, len(recoveryQueue.GetCopyOfApps()), "wrong queue 
length")
+
+       // add recovered forced apps with resource tags
+       app4 := newApplicationTags("app-4", "default", 
common.RecoveryQueueFull, map[string]string{
+               siCommon.AppTagCreateForce:                 "true",
+               siCommon.AppTagNamespaceResourceGuaranteed: 
"{\"resources\":{\"vcore\":{\"value\":111}}}"})
+       err = partition.AddApplication(app4)
+       assert.NilError(t, err, "app4 could not be added")
+       assert.Assert(t, recoveryQueue.GetGuaranteedResource() == nil, 
"guaranteed resource should be unset")
+       assert.Assert(t, recoveryQueue.GetMaxResource() == nil, "max resource 
should be unset")
+       app5 := newApplicationTags("app-5", "default", 
common.RecoveryQueueFull, map[string]string{
+               siCommon.AppTagCreateForce:            "true",
+               siCommon.AppTagNamespaceResourceQuota: 
"{\"resources\":{\"vcore\":{\"value\":111}}}"})
+       err = partition.AddApplication(app5)
+       assert.NilError(t, err, "app5 could not be added")
+       assert.Assert(t, recoveryQueue.GetGuaranteedResource() == nil, 
"guaranteed resource should be unset")
+       assert.Assert(t, recoveryQueue.GetMaxResource() == nil, "max resource 
should be unset")
 }
 
 func TestAddAppForcedWithPlacement(t *testing.T) {


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

Reply via email to