Skip to content

Commit

Permalink
fix rollback unthoroughly when allocate error
Browse files Browse the repository at this point in the history
Signed-off-by: Wenbo Zhang <zhangwenbo40@huawei.com>
  • Loading branch information
Wenbo Zhang committed Mar 21, 2024
1 parent f0d99bf commit e5f0104
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/scheduler/framework/statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,10 @@ func (s *Statement) Commit() {
case Allocate:
err := s.allocate(op.task)
if err != nil {
s.ssn.cache.RevertVolumes(op.task, op.task.PodVolumes)
klog.Errorf("Failed to allocate task: for %s", err.Error())
if e := s.unallocate(op.task); e != nil {
klog.Errorf("Failed to unallocate task <%v/%v>: %v.", op.task.Namespace, op.task.Name, e)
}
klog.Errorf("Failed to allocate task <%v/%v>: %v.", op.task.Namespace, op.task.Name, err)
}
}
}
Expand Down

0 comments on commit e5f0104

Please sign in to comment.