Skip to content

Commit

Permalink
jobs: don't retry revert if permanent job error occurs
Browse files Browse the repository at this point in the history
Release note: wip
  • Loading branch information
rafiss committed Dec 12, 2024
1 parent c32b701 commit 8e712e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/jobs/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,10 @@ func (r *Registry) stepThroughStateMachine(
// mark the job as failed because it can be resumed by another node.
return errors.Errorf("job %d: node liveness error: restarting in background", job.ID())
}
if IsPermanentJobError(err) {
// If there was a permanent error while reverting, then give up on reverting.
return r.stepThroughStateMachine(ctx, execCtx, resumer, job, StatusRevertFailed, err)
}
return onExecutionFailed(err)
case StatusFailed:
if jobErr == nil {
Expand All @@ -1775,9 +1779,6 @@ func (r *Registry) stepThroughStateMachine(
r.removeFromWaitingSets(job.ID())
return jobErr
case StatusRevertFailed:
// TODO(sajjad): Remove StatusRevertFailed and related code in other places in v22.1.
// v21.2 modified all reverting jobs to retry instead of go to revert-failed. Therefore,
// revert-failed state is not reachable after 21.2.
if jobErr == nil {
return errors.AssertionFailedf("job %d: has StatusRevertFailed but no error was provided",
job.ID())
Expand Down

0 comments on commit 8e712e4

Please sign in to comment.