-
Notifications
You must be signed in to change notification settings - Fork 2
Understanding Sidekiq states
Taken from https://github.com/mperham/sidekiq/issues/2760
- Retry - a 'retry' is a job which has failed and will be retried sometime in the future. The Retries tab shows a list of those jobs which will be executed at some point in the future, listed in chronological order.
- Dead - a 'dead' job is one which will no longer be retried but is saved by Sidekiq so it can be manually retried at some point in the near future. The Dead tab lists jobs in this state.
- Failed - is a counter of the number of times any job was executed by Sidekiq and raised an error. Since the default retry policy is 25, a single job can lead to Failed increasing by 25.
The retry
property can be set on a worker or 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 SomeWorker
# 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
Originally posted by @mperham in https://github.com/mperham/sidekiq/issues/2760#issuecomment-170112610
@mperham Your elaboration was very helpful!
If I'm understanding correctly, if there are Failed jobs but no Dead jobs, that would mean the jobs successfully retried, right?
By the way, I think it'd be beneficial to add your explanation to the wiki - perhaps under either Monitoring and/or API.
Originally posted by @codeanpeace in https://github.com/mperham/sidekiq/issues/2760#issuecomment-324378835
Yes, or the Dead jobs were removed or expired. There's so many edge cases that documenting what the number means would take a few paragraphs. I prefer the documentation to be more succinct and task-oriented than that.
Originally posted by @mperham in https://github.com/mperham/sidekiq/issues/2760#issuecomment-324391734
Ahh fair enough, perhaps a data flow diagram that outlines about the jobs workflow to help interpret the dashboard? Something to this effect:
*let me know if I misinterpreted anything here perusing sidekiq/api.rb
Hmm, good to know. I see from the docs that you can manually clear Dead jobs via the API, but how would they expire? Thanks!
Originally posted by @codeanpeace in https://github.com/mperham/sidekiq/issues/2760#issuecomment-324425471
Dead jobs will expire after 6 months or the dead set grows to 10,000 entries. Otherwise the dead set is effectively a memory leak in Redis.
Originally posted by @mperham in https://github.com/mperham/sidekiq/issues/2760#issuecomment-324427306