Skip to content

Commit

Permalink
fix(router): retry backoff causing out-of-order job processing (#3098)
Browse files Browse the repository at this point in the history
  • Loading branch information
atzoum committed Mar 14, 2023
1 parent ea3bbd5 commit eda4525
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,8 @@ func (rt *HandleT) findWorker(job *jobsdb.JobT, throttledOrderKeys map[string]st
//#JobOrder (see other #JobOrder comment)
index := rt.getWorkerPartition(orderKey)
worker := rt.workers[index]
if time.Until(job.LastJobStatus.RetryTime) > 0 { // backoff
if job.LastJobStatus.JobState == jobsdb.Failed.State && job.LastJobStatus.AttemptNum > 0 && time.Until(job.LastJobStatus.RetryTime) > 0 { // backoff
throttledOrderKeys[orderKey] = struct{}{}
return
}
enter, previousFailedJobID := worker.barrier.Enter(orderKey, job.JobID)
Expand Down

0 comments on commit eda4525

Please sign in to comment.