Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-2273

checkLimitMaxApplications fails if there is missing limit in a middle queue

    XMLWordPrintableJSON

Details

    Description

      The checkLimitMaxApplications function rejects config which child limit is large than parent limit. However, it doesn't cover all cases like child limit is large than grandparent limit. Following is my test case:

      func TestCheckLimitMaxApplicationsGrandLevel(t *testing.T) {
          err := checkLimitMaxApplications(
              QueueConfig{
                  Name: "root",
                  Limits: []Limit{
                      {
                          Limit:           "user1",
                          Users:           []string{"user1"},
                          MaxApplications: 100,
                      },
                      {
                          Limit:           "user2",
                          Users:           []string{"user2"},
                          MaxApplications: 100,
                      },
                  },
                  Queues: []QueueConfig{
                      {
                          Name: "parent",
                          Limits: []Limit{
                              {
                                  Limit:           "user1",
                                  Users:           []string{"user1"},
                                  MaxApplications: 50,
                              },
                          },
                          Queues: []QueueConfig{
                              {
                                  Name: "child",
                                  Limits: []Limit{
                                      {
                                          Limit:           "user1",
                                          Users:           []string{"user1"},
                                          MaxApplications: 10,
                                      },
                                      {
                                          Limit:           "user2",
                                          Users:           []string{"user2"},
                                          MaxApplications: 150,
                                      },
                                  },
                              },
                          },
                      },
                  },
              },
              make(map[string]map[string]uint64),
              make(map[string]map[string]uint64),
              common.Empty,
          )
          assert.Equal(t, err != nil, true, "user2 cpu maxapplications in root.parent.child should not be large than root") // this will fail
      }

      Attachments

        Issue Links

          Activity

            People

              yangpoan PoAn Yang
              yangpoan PoAn Yang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: