Check for number of workers before soft failing the task. #104195
@ -188,6 +188,13 @@ func (f *Flamenco) onTaskFailed(
|
|||||||
Int("threshold", threshold).
|
Int("threshold", threshold).
|
||||||
Logger()
|
Logger()
|
||||||
if numFailed < threshold {
|
if numFailed < threshold {
|
||||||
|
numWorkers, err := f.numWorkersCapableOfRunningTask(ctx, task)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if numWorkers == 1 {
|
||||||
|
return f.failJobAfterCatastroficTaskFailure(ctx, logger, worker, task)
|
||||||
|
}
|
||||||
return f.softFailTask(ctx, logger, worker, task, numFailed)
|
return f.softFailTask(ctx, logger, worker, task, numFailed)
|
||||||
}
|
}
|
||||||
return f.hardFailTask(ctx, logger, worker, task, numFailed)
|
return f.hardFailTask(ctx, logger, worker, task, numFailed)
|
||||||
|
Loading…
Reference in New Issue
Block a user