Skip to content

Job Lifecycle

Mike Perham edited this page Feb 13, 2023 · 7 revisions

When first viewing the Web UI, you will probably notice counters for all of the possible states of a job. This is an explanation of what those states mean, and how jobs transition between them.

  • Processed - successfully completed, and no further action will be taken.
  • Failed - the number of times all jobs were executed by Sidekiq and raised an error. Since the default retry policy is 25, a single job can lead to Failed increasing by 25. It's important to note that a job will never end up in Failed, as it's a purely transitive state. The only possible final states are Processed or Dead.
  • Busy - currently processing.
  • Enqueued - waiting for a turn in the processing queue (listed in chronological order, by queue).
  • Retries - failed, but will be automatically retried sometime in the future (listed in chronological order).
  • Scheduled - configured to be run at some point in the future (may be enqueued when their processing time comes up).
  • Dead - will no longer be retried but is saved so it can be manually retried at some point in the near future.

It's important to note that a single job can increment both the Processed and Failed counters if it fails once or more, but succeeds upon retry.

Job Lifecycle Diagram, credit: @codeanpeace

Altering the lifecycle

The retry property can be set on a specific job to disable retries completely (job goes straight to Dead) or disable death (failed job is simply discarded). If your Failed count is increasing but you don't see anything in the Retry or Dead tabs, it's likely you've disabled one or both of those:

class SomeJob
  # will be completely ephemeral, not in Retry or Dead
  sidekiq_options retry: false
  # will go immediately to the Dead tab upon first failure
  sidekiq_options retry: 0