Skip to content

Commit

Permalink
address coment
Browse files Browse the repository at this point in the history
  • Loading branch information
GMHDBJD committed Apr 19, 2023
1 parent 96732b0 commit f434742
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions disttask/framework/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,12 @@ func (s *InternalSchedulerImpl) Run(ctx context.Context, task *proto.Task) error
}
}
minimalTaskWg.Wait()
if err := s.getError(); err != nil {
if errors.Cause(err) == context.Canceled {
s.updateSubtaskState(subtask.ID, proto.TaskStateCanceled)
} else {
s.updateSubtaskState(subtask.ID, proto.TaskStateFailed)
if err := s.getError(); err == nil {
if err := scheduler.OnSubtaskFinished(runCtx, subtask.Meta); err != nil {
s.onError(err)
}
break
}
if err := scheduler.OnSubtaskFinished(runCtx, subtask.Meta); err != nil {
s.onError(err)
if err := s.getError(); err != nil {
if errors.Cause(err) == context.Canceled {
s.updateSubtaskState(subtask.ID, proto.TaskStateCanceled)
} else {
Expand Down

0 comments on commit f434742

Please sign in to comment.