diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e00a864..27baffe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ bugs in actually-released versions. - The conversion from a known path prefix to a variable is now done in a case-insensitive way. This means that if the variable `{storage}` has value `S:\Flamenco`, a path `s:\flamenco\project\file.blend` will be recognised and stored as `{storage}\project\file.blend`. This happens uniformly, regardless of the platform. So also on Linux, which has a case-sensitive filesystem, this matching is done in a case-insensitive way. It is very unlikely that a Flamenco configuration has two separate variables, for paths that only differ in their case. -- Fix issue where jobs could get stuck in `pause-requested` state. +- Fix issue where jobs could get stuck in `pause-requested` state. Such jobs are now also detected at startup of the Manager, and sent to `paused` when possible. ## 3.6 - released 2024-12-01 diff --git a/internal/manager/task_state_machine/task_state_machine.go b/internal/manager/task_state_machine/task_state_machine.go index 4eb150af..35a551b4 100644 --- a/internal/manager/task_state_machine/task_state_machine.go +++ b/internal/manager/task_state_machine/task_state_machine.go @@ -662,7 +662,11 @@ func (sm *StateMachine) CheckStuck(ctx context.Context) { sm.mutex.Lock() defer sm.mutex.Unlock() - stuckJobs, err := sm.persist.FetchJobsInStatus(ctx, api.JobStatusCancelRequested, api.JobStatusRequeueing) + stuckJobs, err := sm.persist.FetchJobsInStatus(ctx, + api.JobStatusCancelRequested, + api.JobStatusRequeueing, + api.JobStatusPauseRequested, + ) if err != nil { log.Error().Err(err).Msg("unable to fetch stuck jobs") return diff --git a/internal/manager/task_state_machine/task_state_machine_test.go b/internal/manager/task_state_machine/task_state_machine_test.go index eeedad26..5f325969 100644 --- a/internal/manager/task_state_machine/task_state_machine_test.go +++ b/internal/manager/task_state_machine/task_state_machine_test.go @@ -447,7 +447,11 @@ func TestCheckStuck(t *testing.T) { // task3 := taskOfSameJob(task2, api.TaskStatusSoftFailed) job.Status = api.JobStatusRequeueing - mocks.persist.EXPECT().FetchJobsInStatus(ctx, api.JobStatusCancelRequested, api.JobStatusRequeueing). + mocks.persist.EXPECT().FetchJobsInStatus(ctx, + api.JobStatusCancelRequested, + api.JobStatusRequeueing, + api.JobStatusPauseRequested, + ). Return([]*persistence.Job{job}, nil) mocks.persist.EXPECT().CountTasksOfJobInStatus(ctx, job, api.TaskStatusCompleted).Return(1, 3, nil)