Set default Sidekiq retries to 3

By default, Sidekiq will retry 25 times with an exponential backoff.
This may result in jobs retrying for up to 21 days. Most Sidekiq
failures occur when attempting to connect to external services -
Project service hooks, web hooks, mailers, mirror updates, etc.
We should set a default retry of 3, and if that's not sufficient
individual workers can override this in the worker class.
This commit is contained in:
Drew Blessing 2016-11-04 14:48:05 -05:00
parent 8d0d8b91e4
commit d498ec98e0
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,4 @@
---
title: Set default Sidekiq retries to 3
merge_request: 7294
author:

View File

@ -2,6 +2,9 @@
redis_config_hash = Gitlab::Redis.params
redis_config_hash[:namespace] = Gitlab::Redis::SIDEKIQ_NAMESPACE
# Default is to retry 25 times with exponential backoff. That's too much.
Sidekiq.default_worker_options = { retry: 3 }
Sidekiq.configure_server do |config|
config.redis = redis_config_hash