Commit 26b34c2a authored by Sean McGivern's avatar Sean McGivern

Remove confusing retry option for cronjob workers

In https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59907 we
explicitly set the number of retries for all existing workers to 3.
However, this included workers that use CronjobQueue, where retries are
disabled, which was confusing. We were essentially doing:

    class MyWorker
      include ApplicationWorker

      sidekiq_options retry: 3 # In the worker class
      include CronjobQueue # Which does ...
      sidekiq_options retry: false # ... and this takes precedence
    end

This change simply removes `retry: 3` from all workers that include the
CronjobQueue. Done with:

    ag -l 'retry: 3' app/workers/ ee/app/workers/ |
      xargs ag -l CronjobQueue |
      xargs -L1 sed -z -i'' 's/\n *sidekiq_options retry: 3\n/\n/g'

But other file searching and editing tools are available too.
parent f062cb0d
......@@ -5,7 +5,6 @@ class AdminEmailWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -8,7 +8,6 @@ module Analytics
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
DEFAULT_DELAY = 3.minutes.freeze
......
......@@ -6,7 +6,6 @@ module AuthorizedProjectUpdate
data_consistency :always
sidekiq_options retry: 3
# This worker does not perform work scoped to a context
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
......
......@@ -6,7 +6,6 @@ module Ci
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :continuous_integration
......
......@@ -7,7 +7,6 @@ module Ci
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -6,7 +6,6 @@ module Ci
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -5,8 +5,6 @@ class CiPlatformMetricsUpdateCronWorker # rubocop:disable Scalability/Idempotent
data_consistency :always
sidekiq_options retry: 3
# This worker does not perform work scoped to a context
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
......
......@@ -7,7 +7,6 @@ module Clusters
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -5,7 +5,6 @@ class ContainerExpirationPolicyWorker # rubocop:disable Scalability/IdempotentWo
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
include ExclusiveLeaseGuard
......
......@@ -6,7 +6,6 @@ module Database
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :database
......
......@@ -4,7 +4,6 @@ module Database
class PartitionManagementWorker
include ApplicationWorker
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
data_consistency :always
......
......@@ -6,7 +6,6 @@ module Environments
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :continuous_delivery
......
......@@ -5,7 +5,6 @@ class ExpireBuildArtifactsWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -10,7 +10,6 @@ module Gitlab
included do
include ApplicationWorker
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker updates several import states inline and does not schedule
# other jobs. So no context needed
......
......@@ -5,7 +5,6 @@ class ImportExportProjectCleanupWorker # rubocop:disable Scalability/IdempotentW
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -5,7 +5,6 @@ class IssueDueSchedulerWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :issue_tracking
......
......@@ -5,7 +5,6 @@ class MemberInvitationReminderEmailsWorker # rubocop:disable Scalability/Idempot
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :subgroups
......
......@@ -7,7 +7,6 @@ module Metrics
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -6,7 +6,6 @@ module Namespaces
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :subgroups
......
......@@ -6,7 +6,6 @@ module Namespaces
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :source_code_management
......
......@@ -7,7 +7,6 @@ module Packages
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :package_registry
......
......@@ -5,7 +5,6 @@ class PagesDomainRemovalCronWorker # rubocop:disable Scalability/IdempotentWorke
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
feature_category :pages
......
......@@ -5,7 +5,6 @@ class PagesDomainSslRenewalCronWorker # rubocop:disable Scalability/IdempotentWo
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
feature_category :pages
......
......@@ -5,7 +5,6 @@ class PagesDomainVerificationCronWorker # rubocop:disable Scalability/Idempotent
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
feature_category :pages
......
......@@ -5,7 +5,6 @@ class PartitionCreationWorker
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :database
......
......@@ -6,7 +6,6 @@ module PersonalAccessTokens
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
feature_category :authentication_and_authorization
......
......@@ -6,7 +6,6 @@ module PersonalAccessTokens
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
feature_category :authentication_and_authorization
......
......@@ -5,7 +5,6 @@ class PipelineScheduleWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
feature_category :continuous_integration
......
......@@ -5,7 +5,6 @@ class PruneOldEventsWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -6,7 +6,6 @@ module Releases
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :release_evidence
......
......@@ -5,7 +5,6 @@ class RemoveExpiredGroupLinksWorker # rubocop:disable Scalability/IdempotentWork
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :authentication_and_authorization
......
......@@ -5,7 +5,6 @@ class RemoveExpiredMembersWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
feature_category :authentication_and_authorization
......
......@@ -5,7 +5,6 @@ class RemoveUnacceptedMemberInvitesWorker # rubocop:disable Scalability/Idempote
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :authentication_and_authorization
......
......@@ -5,7 +5,6 @@ class RemoveUnreferencedLfsObjectsWorker
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -5,7 +5,6 @@ class RepositoryArchiveCacheWorker # rubocop:disable Scalability/IdempotentWorke
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -6,7 +6,6 @@ module RepositoryCheck
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -5,7 +5,6 @@ class RequestsProfilesWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -5,7 +5,6 @@ class ScheduleMergeRequestCleanupRefsWorker
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :code_review
......
......@@ -5,7 +5,6 @@ class ScheduleMigrateExternalDiffsWorker # rubocop:disable Scalability/Idempoten
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext:
# This schedules the `MigrateExternalDiffsWorker`
# issue for adding context: https://gitlab.com/gitlab-org/gitlab/issues/202100
......
......@@ -6,7 +6,6 @@ module SshKeys
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
feature_category :compliance_management
......
......@@ -6,7 +6,6 @@ module SshKeys
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
feature_category :compliance_management
......
......@@ -5,7 +5,6 @@ class StuckCiJobsWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
feature_category :continuous_integration
......
......@@ -6,7 +6,6 @@ class StuckExportJobsWorker
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker updates export states inline and does not schedule
# other jobs.
......
......@@ -5,7 +5,6 @@ class StuckMergeJobsWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :code_review
......
......@@ -5,7 +5,6 @@ class TrendingProjectsWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :source_code_management
......
......@@ -5,7 +5,6 @@ class UpdateContainerRegistryInfoWorker
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :container_registry
......
......@@ -7,7 +7,6 @@ module UserStatusCleanup
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
include CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
......
......@@ -6,7 +6,6 @@ module Users
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -5,7 +5,6 @@ class X509IssuerCrlCheckWorker
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
feature_category :source_code_management
......
......@@ -5,7 +5,6 @@ class ActiveUserCountThresholdWorker # rubocop:disable Scalability/IdempotentWor
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -5,7 +5,6 @@ class AdjournedGroupDeletionWorker # rubocop:disable Scalability/IdempotentWorke
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
INTERVAL = 10.seconds.to_i
......
......@@ -5,7 +5,6 @@ class AdjournedProjectsDeletionCronWorker # rubocop:disable Scalability/Idempote
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue
INTERVAL = 10.seconds.to_i
......
......@@ -8,7 +8,6 @@ module Analytics
data_consistency :always
sidekiq_options retry: 3
# This worker does not perform work scoped to a context
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
......
......@@ -5,7 +5,6 @@ class ClearSharedRunnersMinutesWorker # rubocop:disable Scalability/IdempotentWo
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
# all queries are scoped across multiple namespaces
......
......@@ -6,7 +6,6 @@ module Elastic
data_consistency :always
sidekiq_options retry: 3
include Gitlab::ExclusiveLeaseHelpers
# There is no onward scheduling and this cron handles work from across the
# application, so there's no useful context to add.
......
......@@ -5,7 +5,6 @@ class ElasticRemoveExpiredNamespaceSubscriptionsFromIndexCronWorker
data_consistency :always
sidekiq_options retry: 3
include Gitlab::ExclusiveLeaseHelpers
include CronjobQueue
......
......@@ -6,7 +6,6 @@ module Geo
data_consistency :always
sidekiq_options retry: 3
include ExclusiveLeaseGuard
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
......
......@@ -6,7 +6,6 @@ module Geo
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -7,7 +7,6 @@ module Geo
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -10,7 +10,6 @@ module Geo
data_consistency :always
sidekiq_options retry: 3
prepend Reenqueuer
include ::Gitlab::Geo::LogHelpers
......
......@@ -8,7 +8,6 @@ module Geo
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
include ::Gitlab::Geo::LogHelpers
include ExclusiveLeaseGuard
......
......@@ -6,7 +6,6 @@ module Geo
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -9,7 +9,6 @@ module Geo
data_consistency :always
sidekiq_options retry: 3
include ::Gitlab::Geo::LogHelpers
# This worker does not perform work scoped to a context
......
......@@ -5,7 +5,6 @@ class HistoricalDataWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -6,7 +6,6 @@ module IncidentManagement
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
idempotent!
......
......@@ -5,7 +5,6 @@ class LdapAllGroupsSyncWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -5,7 +5,6 @@ class LdapSyncWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :authentication_and_authorization
......
......@@ -5,7 +5,6 @@ class PseudonymizerWorker # rubocop:disable Scalability/IdempotentWorker
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -3,7 +3,6 @@
class UpdateAllMirrorsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
sidekiq_options retry: 3
include CronjobQueue
feature_category :source_code_management
......
......@@ -5,7 +5,6 @@ class UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker # rubocop:disable Scalab
data_consistency :always
sidekiq_options retry: 3
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
feature_category :utilization
......
......@@ -7,7 +7,6 @@ module Vulnerabilities
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
......@@ -7,7 +7,6 @@ module Vulnerabilities
data_consistency :always
sidekiq_options retry: 3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include CronjobQueue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment