Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YUNIKORN-2991] The queue in Draining state does not accept new applications #1002

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/scheduler/placement/placement.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ func (m *AppPlacementManager) PlaceApplication(app *objects.Application) error {
queueName = ""
continue
}
// Check if the queue in Draining state, and if so, proceed to the next rule
if queue.IsDraining() {
log.Log(log.SchedApplication).Debug("Cannot Placing application in draining queue",
zap.String("queueName", queueName),
zap.String("ruleName", checkRule.getName()),
zap.String("application", app.ApplicationID))
// reset the queue name for the last rule in the chain
queueName = ""
continue
}
}
// we have a queue that allows submitting and can be created: app placed
log.Log(log.SchedApplication).Info("Rule result for placing application",
Expand Down
9 changes: 9 additions & 0 deletions pkg/scheduler/placement/placement_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,15 @@ partitions:
if err == nil || queueName != "" {
t.Errorf("parent queue: app should not have been placed, queue: '%s', error: %v", queueName, err)
}

// provided rule (2nd): submit to draining queue
app = newApplication("app1", "default", "root.testparent.testchild", user, nil, nil, "")
man.queueFn("root.testparent.testchild").MarkQueueForRemoval()
err = man.PlaceApplication(app)
queueName = app.GetQueuePath()
if err == nil || queueName != "" {
t.Errorf("Cannot Placing application in draining queue: '%s', error: %v", queueName, err)
}
}

//nolint:funlen
Expand Down