Skip to content

Commit

Permalink
Merge pull request #225 from sgotti/runservice_fix_handling_of_wrong_…
Browse files Browse the repository at this point in the history
…executortask_status

runservice: fix handling of wrong executortask status
  • Loading branch information
sgotti authored Mar 2, 2020
2 parents 4da7c23 + 19611c1 commit eb180da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/services/runservice/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,13 @@ func (s *Runservice) updateRunTaskStatus(ctx context.Context, et *types.Executor
}
case types.ExecutorTaskPhaseStopped:
if rt.Status != types.RunTaskStatusStopped &&
rt.Status != types.RunTaskStatusNotStarted &&
rt.Status != types.RunTaskStatusRunning {
wrongstatus = true
}
case types.ExecutorTaskPhaseSuccess:
if rt.Status != types.RunTaskStatusSuccess &&
rt.Status != types.RunTaskStatusNotStarted &&
rt.Status != types.RunTaskStatusRunning {
wrongstatus = true
}
Expand All @@ -672,7 +674,7 @@ func (s *Runservice) updateRunTaskStatus(ctx context.Context, et *types.Executor
}
}
if wrongstatus {
log.Warnf("wrong executor task %q status: %q, rt status: %q", et.ID, et.Status.Phase, rt.Status)
log.Warnf("ignoring wrong executor task %q status: %q, rt status: %q", et.ID, et.Status.Phase, rt.Status)
return nil
}

Expand Down

0 comments on commit eb180da

Please sign in to comment.