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

The allocate phase only updates the podgroup in the pending state to the inqueue state #2658

Merged
Merged
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion pkg/scheduler/actions/allocate/allocate.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (alloc *Action) Execute(ssn *framework.Session) {

for _, job := range ssn.Jobs {
// If not config enqueue action, change Pending pg into Inqueue statue to avoid blocking job scheduling.
if !conf.EnabledActionMap["enqueue"] {
if !conf.EnabledActionMap["enqueue"] && job.IsPending() {
Copy link
Contributor

@Thor-wl Thor-wl Jan 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's LGTM generally. Some kind suggestions are as follows:

  1. If this patch is in use, suggest to refactor the else section like this: else if job.IsPending(), which may be more readable and clean.
  2. IMO, a more reasonable way is to filter podgroups which are not at completed status at the stage of snapshot. If that, only podgroups, which are to be allocated resources, will enter the session. Besides, it will improve the performance.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your suggestion, the first question has been optimized.

There are still some doubts about the second question. The function implemented here is to prevent the job in the pending state from blocking when the enqueue action is not configured, so the processing logic for updating the pending job to the inqueue state is added.

However, before the update, the status of the job was not judged, but all status jobs were updated to inqueue (including running, unknown, and completed). This kind of processing did not meet the original intention, and also caused the problem recorded in the issue.

I understand that by correcting this, the problem in the issue should be solved first. For the filtering of the job in the completed state, can it not be processed for the time being?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got you. Before reviewing this PR, I've looked through the related issue. If available, can you help for the filter in the later PR?

job.PodGroup.Status.Phase = scheduling.PodGroupInqueue
} else {
if job.IsPending() {
Expand Down