Skip to content
Snippets Groups Projects
Unverified Commit ab0f9788 authored by Sean McGivern's avatar Sean McGivern
Browse files

Explicitly set retries to 3 for all existing Sidekiq workers

Some time ago, we set the default number of Sidekiq retries to 3. In the
next commit we're going to change that to 25, but we only want it to
apply to new workers. So we'll first need to explicitly set all existing
workers to 3.

To aid with this, I used the below script. I had to make a couple of
tweaks for some worker concerns, but it covered most of the several
hundred workers we have:

    Dir.glob('{ee/,}app/workers/**/*.rb').select do |worker|
      contents = open(worker).read

      next unless contents.include?('ApplicationWorker')
      next if contents.include?('sidekiq_options retry: ')

      new_contents =
        contents.gsub(/^( +)include ApplicationWorker$/,
                      "\\1include ApplicationWorker\n\n" +
                      "\\1sidekiq_options retry: 3")

      open(worker, 'w').puts(new_contents)
    end
parent 4a61262a
No related branches found
No related tags found
No related merge requests found
Showing
with 40 additions and 0 deletions
Loading
Loading
@@ -2,6 +2,8 @@
 
class AdminEmailWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
Loading
Loading
Loading
Loading
@@ -5,6 +5,8 @@ module InstanceStatistics
# This worker will be removed in 14.0
class CountJobTriggerWorker
include ApplicationWorker
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
 
feature_category :devops_reports
Loading
Loading
Loading
Loading
@@ -6,6 +6,8 @@ module InstanceStatistics
class CounterJobWorker
include ApplicationWorker
 
sidekiq_options retry: 3
feature_category :devops_reports
urgency :low
 
Loading
Loading
Loading
Loading
@@ -5,6 +5,8 @@ module UsageTrends
class CountJobTriggerWorker
extend ::Gitlab::Utils::Override
include ApplicationWorker
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
 
DEFAULT_DELAY = 3.minutes.freeze
Loading
Loading
Loading
Loading
@@ -6,6 +6,8 @@ class CounterJobWorker
extend ::Gitlab::Utils::Override
include ApplicationWorker
 
sidekiq_options retry: 3
feature_category :devops_reports
urgency :low
 
Loading
Loading
Loading
Loading
@@ -3,6 +3,8 @@
class ApproveBlockedPendingApprovalUsersWorker
include ApplicationWorker
 
sidekiq_options retry: 3
idempotent!
 
feature_category :users
Loading
Loading
Loading
Loading
@@ -2,6 +2,8 @@
 
class ArchiveTraceWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
sidekiq_options retry: 3
include PipelineBackgroundQueue
 
# rubocop: disable CodeReuse/ActiveRecord
Loading
Loading
Loading
Loading
@@ -3,6 +3,8 @@
class AuthorizedKeysWorker
include ApplicationWorker
 
sidekiq_options retry: 3
PERMITTED_ACTIONS = %w[add_key remove_key].freeze
 
feature_category :source_code_management
Loading
Loading
Loading
Loading
@@ -3,6 +3,8 @@
module AuthorizedProjectUpdate
class PeriodicRecalculateWorker
include ApplicationWorker
sidekiq_options retry: 3
# This worker does not perform work scoped to a context
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
 
Loading
Loading
Loading
Loading
@@ -4,6 +4,8 @@ module AuthorizedProjectUpdate
class ProjectCreateWorker
include ApplicationWorker
 
sidekiq_options retry: 3
feature_category :authentication_and_authorization
urgency :low
queue_namespace :authorized_project_update
Loading
Loading
Loading
Loading
@@ -4,6 +4,8 @@ module AuthorizedProjectUpdate
class ProjectGroupLinkCreateWorker
include ApplicationWorker
 
sidekiq_options retry: 3
feature_category :authentication_and_authorization
urgency :low
queue_namespace :authorized_project_update
Loading
Loading
Loading
Loading
@@ -15,6 +15,8 @@ class UserRefreshOverUserRangeWorker # rubocop:disable Scalability/IdempotentWor
 
include ApplicationWorker
 
sidekiq_options retry: 3
feature_category :authentication_and_authorization
urgency :low
queue_namespace :authorized_project_update
Loading
Loading
Loading
Loading
@@ -2,6 +2,8 @@
 
class AuthorizedProjectsWorker
include ApplicationWorker
sidekiq_options retry: 3
prepend WaitableWorker
 
feature_category :authentication_and_authorization
Loading
Loading
Loading
Loading
@@ -3,6 +3,8 @@
module AutoDevops
class DisableWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
sidekiq_options retry: 3
include AutoDevopsQueue
 
def perform(pipeline_id)
Loading
Loading
Loading
Loading
@@ -3,6 +3,8 @@
class AutoMergeProcessWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
 
sidekiq_options retry: 3
queue_namespace :auto_merge
feature_category :continuous_delivery
worker_resource_boundary :cpu
Loading
Loading
Loading
Loading
@@ -3,6 +3,8 @@
class BackgroundMigrationWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
 
sidekiq_options retry: 3
feature_category :database
urgency :throttled
loggable_arguments 0, 1
Loading
Loading
Loading
Loading
@@ -2,6 +2,8 @@
 
class BuildFinishedWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
sidekiq_options retry: 3
include PipelineQueue
 
queue_namespace :pipeline_processing
Loading
Loading
Loading
Loading
@@ -2,6 +2,8 @@
 
class BuildHooksWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
sidekiq_options retry: 3
include PipelineQueue
 
queue_namespace :pipeline_hooks
Loading
Loading
Loading
Loading
@@ -2,6 +2,8 @@
 
class BuildQueueWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
sidekiq_options retry: 3
include PipelineQueue
 
queue_namespace :pipeline_processing
Loading
Loading
Loading
Loading
@@ -2,6 +2,8 @@
 
class BuildSuccessWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
sidekiq_options retry: 3
include PipelineQueue
 
queue_namespace :pipeline_processing
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment