Support pausing jobs #104313

Manually merged
Sybren A. Stüvel merged 28 commits from David-Zhang-10/flamenco:paused-job-status into main 2024-07-01 17:53:44 +02:00
Showing only changes of commit a84097e59f - Show all commits

View File

@ -5,6 +5,7 @@ package task_state_machine
import (
"context"
"fmt"
"projects.blender.org/studio/flamenco/pkg/website"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
@ -471,9 +472,9 @@ func (sm *StateMachine) pauseTasks(
return api.JobStatusPaused, nil
}
// This could mean pause was triggered by failure of the job, in which case the
// job is already in the correct status.
return "", nil
// This could mean state transition entered a non-recoverable error state.
log.Warn().Str("jobStatus", string(job.Status)).Msgf("unexpected job status in StateMachine::pauseTasks(), please report this at %s", website.BugReportURL)
return "", fmt.Errorf("unexpected job status %q in StateMachine::pauseTasks()", job.Status)
}
// requeueTasks re-queues all tasks of the job.