Skip to content
danschumann edited this page Oct 22, 2012 · 19 revisions

I hate to say it but some of your workers will crash when processing messages. It's true.

Sidekiq provides two critical features to handle this unfortunate eventuality:

  1. Exception notification - Sidekiq integrates with the top three exception notification services in the Ruby world: Airbrake, Exceptional and ExceptionNotifier (the exception_notification gem now). When a worker raises an error, the error and message contents will be sent to the service so that you can be notified and fix the bug.
  2. Automatic failure retry - Sidekiq will retry processing failures with an exponential backoff using the formula retry_count**4 + 15 (i.e. 15, 16, 31, 96, 271, ... seconds). It will perform 25 retries over approximately 20 days. Assuming you deploy a bug fix within that time, the message will get retried and successfully processed. After 25 times, Sidekiq will drop the message assuming that it will never be successfully processed.

You can disable retry support for a particular worker:

class NonRetryableWorker
  include Sidekiq::Worker
  sidekiq_options :retry => false

  def perform(...)
  end
end
Clone this wiki locally