Sidekiq can notify you when a Batch is complete or successful with batch.on(event, klass, options={}):
complete - when all jobs in the batch have run once, successful or not.
success - when all jobs in the batch have completed successfully.
death - the first time a batch job dies
Regarding success, if a job fails continually it's possible the success event will never fire. If a job fails all retries and dies, it will fire any :death callbacks. The :death callback is always fired for first job in the batch that fails and does not retry. Even if you configure jobs to disable retries or job death, it will still fire the :death callback.
:death and :success are not mutually exclusive but the death callback firing means that the batch will not fire success without manual intervention. If you deploy a fix and manually re-enqueue a dead batch job, the batch can still fire :success.
But sidekiq-batch (lib/sidekiq/batch/callback.rb:8) silently fails if :death is passed.
Sidekiq Pro has a death callback:
But sidekiq-batch (
lib/sidekiq/batch/callback.rb:8
) silently fails if:death
is passed.