Skip to content

Commit

Permalink
Revert "fix scheduler panic issue (volcano-sh#39)"
Browse files Browse the repository at this point in the history
This reverts commit 176de8f.
  • Loading branch information
yolgun committed Oct 24, 2022
1 parent e3b4238 commit 3d2ff4f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pkg/scheduler/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,26 +825,22 @@ func (sc *SchedulerCache) processBindTask() {

func (sc *SchedulerCache) BindTask() {
klog.V(5).Infof("batch bind task count %d", len(sc.bindCache))
successfulTasks := make([]*schedulingapi.TaskInfo, 0)
for _, task := range sc.bindCache {
if err := sc.VolumeBinder.BindVolumes(task, task.PodVolumes); err != nil {
klog.Errorf("task %s/%s bind Volumes failed: %#v", task.Namespace, task.Name, err)
sc.VolumeBinder.RevertVolumes(task, task.PodVolumes)
sc.resyncTask(task)
} else {
successfulTasks = append(successfulTasks, task)
klog.V(5).Infof("task %s/%s bind Volumes done", task.Namespace, task.Name)
return
}
}

bindTasks := make([]*schedulingapi.TaskInfo, len(successfulTasks))
copy(bindTasks, successfulTasks)
bindTasks := make([]*schedulingapi.TaskInfo, len(sc.bindCache))
copy(bindTasks, sc.bindCache)
if err := sc.Bind(bindTasks); err != nil {
klog.Errorf("failed to bind task count %d: %#v", len(bindTasks), err)
return
}

for _, task := range successfulTasks {
for _, task := range sc.bindCache {
metrics.UpdateTaskScheduleDuration(metrics.Duration(task.Pod.CreationTimestamp.Time))
}

Expand Down

0 comments on commit 3d2ff4f

Please sign in to comment.