runservice: fix handling of wrong executortask status
updateRunTaskStatus should also accept transitions from not started to a finished state like "success", "failed", "stopped" since we could miss some status updates from the executor for many reasons.
This commit is contained in:
parent
a4e280cd7d
commit
19611c18e7
|
@ -671,11 +671,13 @@ func (s *Runservice) updateRunTaskStatus(ctx context.Context, et *types.Executor
|
||||||
}
|
}
|
||||||
case types.ExecutorTaskPhaseStopped:
|
case types.ExecutorTaskPhaseStopped:
|
||||||
if rt.Status != types.RunTaskStatusStopped &&
|
if rt.Status != types.RunTaskStatusStopped &&
|
||||||
|
rt.Status != types.RunTaskStatusNotStarted &&
|
||||||
rt.Status != types.RunTaskStatusRunning {
|
rt.Status != types.RunTaskStatusRunning {
|
||||||
wrongstatus = true
|
wrongstatus = true
|
||||||
}
|
}
|
||||||
case types.ExecutorTaskPhaseSuccess:
|
case types.ExecutorTaskPhaseSuccess:
|
||||||
if rt.Status != types.RunTaskStatusSuccess &&
|
if rt.Status != types.RunTaskStatusSuccess &&
|
||||||
|
rt.Status != types.RunTaskStatusNotStarted &&
|
||||||
rt.Status != types.RunTaskStatusRunning {
|
rt.Status != types.RunTaskStatusRunning {
|
||||||
wrongstatus = true
|
wrongstatus = true
|
||||||
}
|
}
|
||||||
|
@ -687,7 +689,7 @@ func (s *Runservice) updateRunTaskStatus(ctx context.Context, et *types.Executor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if wrongstatus {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue