PoAn Yang created YUNIKORN-2130:
-----------------------------------
Summary: checkLimitResource fails if there is missing limit in a
middle queue
Key: YUNIKORN-2130
URL: https://issues.apache.org/jira/browse/YUNIKORN-2130
Project: Apache YuniKorn
Issue Type: Bug
Components: core - scheduler
Reporter: PoAn Yang
Assignee: PoAn Yang
The checkLimitResource 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:
{noformat}
func TestCheckLimitResourceGrandLevel(t *testing.T) {
err := checkLimitResource(
QueueConfig{
Name: "root",
Limits: []Limit{
{
Limit: "user1",
Users: []string{"user1"},
MaxResources: map[string]string{
"cpu": "100",
},
},
{
Limit: "user2",
Users: []string{"user2"},
MaxResources: map[string]string{
"cpu": "100",
},
},
},
Queues: []QueueConfig{
{
Name: "parent",
Limits: []Limit{
{
Limit: "user1",
Users: []string{"user1"},
MaxResources: map[string]string{
"cpu": "50",
},
},
},
Queues: []QueueConfig{
{
Name: "child",
Limits: []Limit{
{
Limit: "user1",
Users: []string{"user1"},
MaxResources: map[string]string{
"cpu": "10",
},
},
{
Limit: "user2",
Users: []string{"user2"},
MaxResources: map[string]string{
"cpu": "150",
},
},
},
},
},
},
},
},
make(map[string]map[string]*resources.Resource),
make(map[string]map[string]*resources.Resource),
common.Empty,
)
assert.Equal(t, err != nil, true, "user2 cpu maxresources in
root.parent.child should not be large than root") // this will fail
}{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]