diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-04 12:11:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-04 12:11:58 +0000 |
commit | 0327ce54a7e315b3aa6f80cc4e540fbb6792f2e3 (patch) | |
tree | f27611f4cc36d1aa9215e5bd0ff4787e60e77bd0 /config | |
parent | 266aad4e70f3c642583ab60894b27b2622095cd8 (diff) | |
download | gitlab-ce-0327ce54a7e315b3aa6f80cc4e540fbb6792f2e3.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config')
-rw-r--r-- | config/gitlab.yml.example | 3 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 1 | ||||
-rw-r--r-- | config/initializers/7_redis.rb | 6 | ||||
-rw-r--r-- | config/initializers/mailer_retries.rb | 40 | ||||
-rw-r--r-- | config/initializers/sidekiq.rb | 7 | ||||
-rw-r--r-- | config/initializers_before_autoloader/002_sidekiq.rb | 4 | ||||
-rw-r--r-- | config/sidekiq_queues.yml | 2 |
7 files changed, 18 insertions, 45 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index a8881fd8a2e..89f2d82c629 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -1218,6 +1218,9 @@ production: &base # The URL to the internal KAS API (used by the GitLab backend) # internal_url: grpc://localhost:8153 + # The URL to the Kubernetes API proxy (used by GitLab users) + # external_k8s_proxy_url: https://localhost:8154 # default: nil + ## GitLab Elasticsearch settings elasticsearch: indexer_path: /home/git/gitlab-elasticsearch-indexer/ diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 2e8e625067f..0e4e6f5cc84 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -757,6 +757,7 @@ Settings.gitlab_kas['enabled'] ||= false Settings.gitlab_kas['secret_file'] ||= Rails.root.join('.gitlab_kas_secret') Settings.gitlab_kas['external_url'] ||= 'wss://kas.example.com' Settings.gitlab_kas['internal_url'] ||= 'grpc://localhost:8153' +# Settings.gitlab_kas['external_k8s_proxy_url'] ||= 'grpc://localhost:8154' # NOTE: Do not set a default until all distributions have been updated with a correct value # # Repositories diff --git a/config/initializers/7_redis.rb b/config/initializers/7_redis.rb index f861bf65367..d6a2d070cc4 100644 --- a/config/initializers/7_redis.rb +++ b/config/initializers/7_redis.rb @@ -1,5 +1,11 @@ # frozen_string_literal: true +# We set the instance variable directly to suppress warnings. +# We cannot switch to the new behavior until we change all existing `redis.exists` calls to `redis.exists?`. +# Some gems also need to be updated +# https://gitlab.com/gitlab-org/gitlab/-/issues/340602 +Redis.instance_variable_set(:@exists_returns_integer, false) + Redis::Client.prepend(Gitlab::Instrumentation::RedisInterceptor) # Make sure we initialize a Redis connection pool before multi-threaded diff --git a/config/initializers/mailer_retries.rb b/config/initializers/mailer_retries.rb index 64fb0ffaa55..5980513af92 100644 --- a/config/initializers/mailer_retries.rb +++ b/config/initializers/mailer_retries.rb @@ -1,41 +1,5 @@ # frozen_string_literal: true -class ActiveJob::QueueAdapters::SidekiqAdapter - # With Sidekiq 6, we can do something like: - # class ActionMailer::MailDeliveryJob - # sidekiq_options retry: 3 - # end - # - # See https://gitlab.com/gitlab-org/gitlab/-/issues/329430 - raise "Update this monkey patch: #{__FILE__}" unless Sidekiq::VERSION == '5.2.9' - - def enqueue(job) #:nodoc: - # Sidekiq::Client does not support symbols as keys - job.provider_job_id = Sidekiq::Client.push \ - "class" => JobWrapper, - "wrapped" => job.class.to_s, - "queue" => job.queue_name, - "args" => [job.serialize], - "retry" => retry_for(job) - end - - def enqueue_at(job, timestamp) #:nodoc: - job.provider_job_id = Sidekiq::Client.push \ - "class" => JobWrapper, - "wrapped" => job.class.to_s, - "queue" => job.queue_name, - "args" => [job.serialize], - "at" => timestamp, - "retry" => retry_for(job) - end - - private - - def retry_for(job) - if job.queue_name == 'mailers' - 3 - else - true - end - end +Rails.application.config.after_initialize do + ActionMailer::MailDeliveryJob.sidekiq_options retry: 3 end diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 739ed3a8b06..076c6a447e8 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -27,8 +27,13 @@ use_sidekiq_daemon_memory_killer = ENV.fetch("SIDEKIQ_DAEMON_MEMORY_KILLER", 1). use_sidekiq_legacy_memory_killer = !use_sidekiq_daemon_memory_killer Sidekiq.configure_server do |config| + config.options[:strict] = false + config.options[:queues] = Gitlab::SidekiqConfig.expand_queues(config.options[:queues]) + + Sidekiq.logger.info "Listening on queues #{config.options[:queues].uniq.sort}" + if enable_json_logs - Sidekiq.logger.formatter = Gitlab::SidekiqLogging::JSONFormatter.new + config.log_formatter = Gitlab::SidekiqLogging::JSONFormatter.new config.options[:job_logger] = Gitlab::SidekiqLogging::StructuredLogger # Remove the default-provided handler. The exception is logged inside diff --git a/config/initializers_before_autoloader/002_sidekiq.rb b/config/initializers_before_autoloader/002_sidekiq.rb index 8e2def08279..9ffcf39d6fb 100644 --- a/config/initializers_before_autoloader/002_sidekiq.rb +++ b/config/initializers_before_autoloader/002_sidekiq.rb @@ -8,10 +8,6 @@ require 'sidekiq/web' -# Disable the Sidekiq Rack session since GitLab already has its own session store. -# CSRF protection still works (https://github.com/mperham/sidekiq/commit/315504e766c4fd88a29b7772169060afc4c40329). -Sidekiq::Web.set :sessions, false - if Rails.env.development? Sidekiq.default_worker_options[:backtrace] = true end diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index fa6ff3eb568..a5f66995318 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -277,8 +277,6 @@ - 1 - - pages_domain_verification - 1 -- - pages_remove - - 1 - - pages_transfer - 1 - - pages_update_configuration |