diff --git a/Gemfile b/Gemfile index f2acfd06e73..eb279eec87f 100644 --- a/Gemfile +++ b/Gemfile @@ -207,7 +207,7 @@ gem 'seed-fu', '~> 2.3.7' # rubocop:todo Gemfile/MissingFeatureCategory gem 'elasticsearch-model', '~> 7.2' # rubocop:todo Gemfile/MissingFeatureCategory gem 'elasticsearch-rails', '~> 7.2', require: 'elasticsearch/rails/instrumentation' # rubocop:todo Gemfile/MissingFeatureCategory gem 'elasticsearch-api', '7.13.3' # rubocop:todo Gemfile/MissingFeatureCategory -gem 'aws-sdk-core', '~> 3.191.1' # rubocop:todo Gemfile/MissingFeatureCategory +gem 'aws-sdk-core', '~> 3.191.2' # rubocop:todo Gemfile/MissingFeatureCategory gem 'aws-sdk-cloudformation', '~> 1' # rubocop:todo Gemfile/MissingFeatureCategory gem 'aws-sdk-s3', '~> 1.143.0' # rubocop:todo Gemfile/MissingFeatureCategory gem 'faraday_middleware-aws-sigv4', '~>0.3.0' # rubocop:todo Gemfile/MissingFeatureCategory @@ -564,7 +564,7 @@ gem 'kas-grpc', '~> 0.4.0', feature_category: :deployment_management gem 'grpc', '~> 1.60.0' # rubocop:todo Gemfile/MissingFeatureCategory -gem 'google-protobuf', '~> 3.25', '>= 3.25.1' # rubocop:todo Gemfile/MissingFeatureCategory +gem 'google-protobuf', '~> 3.25', '>= 3.25.3' # rubocop:todo Gemfile/MissingFeatureCategory gem 'toml-rb', '~> 2.2.0' # rubocop:todo Gemfile/MissingFeatureCategory diff --git a/Gemfile.checksum b/Gemfile.checksum index 6c0918adaec..744f0af19dc 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -37,7 +37,7 @@ {"name":"aws-eventstream","version":"1.3.0","platform":"ruby","checksum":"f1434cc03ab2248756eb02cfa45e900e59a061d7fbdc4a9fd82a5dd23d796d3f"}, {"name":"aws-partitions","version":"1.877.0","platform":"ruby","checksum":"9552ed7bbd3700ed1eeb0121c160ceaf64fa5dbaff5a1ff5fe6fd8481ecd9cfd"}, {"name":"aws-sdk-cloudformation","version":"1.41.0","platform":"ruby","checksum":"31e47539719734413671edf9b1a31f8673fbf9688549f50c41affabbcb1c6b26"}, -{"name":"aws-sdk-core","version":"3.191.1","platform":"ruby","checksum":"f8608fc0569cbe4c6be07f4d4978b5f537ab990faeb501fc4532888f0e02c83b"}, +{"name":"aws-sdk-core","version":"3.191.2","platform":"ruby","checksum":"acc195bd9222ef03f456fd15347135779d42e4d438ef1ac86906f473f1a9e4b6"}, {"name":"aws-sdk-kms","version":"1.76.0","platform":"ruby","checksum":"e7f75013cba9ba357144f66bbc600631c192e2cda9dd572794be239654e2cf49"}, {"name":"aws-sdk-s3","version":"1.143.0","platform":"ruby","checksum":"7a2cef087c73eacc2a50712440af97a9e3d8ea9ae80794b6a82794cf7c5f4ee9"}, {"name":"aws-sigv4","version":"1.8.0","platform":"ruby","checksum":"84dd99768b91b93b63d1d8e53ee837cfd06ab402812772a7899a78f9f9117cbc"}, @@ -254,16 +254,16 @@ {"name":"google-cloud-location","version":"0.6.0","platform":"ruby","checksum":"386c99ca156e5cac413731c055d7d9c55629860129ad7658a2bf39ea5004d2d0"}, {"name":"google-cloud-profiler-v2","version":"0.4.0","platform":"ruby","checksum":"53fc2ab175d08f54233c644310d47798feac996220916815c4fb44c937b5d3e3"}, {"name":"google-cloud-storage","version":"1.45.0","platform":"ruby","checksum":"f280abda4e608f9e91433f9dd907be4a45cdbf251ffeb275d713548e515c6300"}, -{"name":"google-protobuf","version":"3.25.2","platform":"aarch64-linux","checksum":"d2b18fbcb816d72d0c1c7d874fa618eaf61e2fc26c86462c32dc4dbf7ec20065"}, -{"name":"google-protobuf","version":"3.25.2","platform":"arm64-darwin","checksum":"c1dab355ff82accc23f5ce047c077f04babd2d84ff6ec1cf5d2cf56689554eee"}, -{"name":"google-protobuf","version":"3.25.2","platform":"java","checksum":"f379c7384d4d42a85746b2c735be9d5ea43e204c174a7d3d42460cd44236e93a"}, -{"name":"google-protobuf","version":"3.25.2","platform":"ruby","checksum":"9c2e6121d768f812f50b78cb6f26056f2af6bab92af793d376b772126e26500b"}, -{"name":"google-protobuf","version":"3.25.2","platform":"x64-mingw-ucrt","checksum":"45e1c1ed343fd0e0742f4fd75b1ce0ec88725f8f41ba2fe14bd710a9d37d9006"}, -{"name":"google-protobuf","version":"3.25.2","platform":"x64-mingw32","checksum":"d2b64779a8dfa689dbb2c9afe1d5da02a5d31225168d456a42af33e3838d59e3"}, -{"name":"google-protobuf","version":"3.25.2","platform":"x86-linux","checksum":"741d2504d66872b0b2bd6f5f76337ea0ea41b4d480da1a7632787a2c20d2fefc"}, -{"name":"google-protobuf","version":"3.25.2","platform":"x86-mingw32","checksum":"1be544c9a6c8b099739cb5ad43009bb7a692b7e422c8b0c80cb4a8ffcba8d44a"}, -{"name":"google-protobuf","version":"3.25.2","platform":"x86_64-darwin","checksum":"8865652e25d56e4caa51d441348d55ff5fd7c20e751b6b72dc39b4303c394b40"}, -{"name":"google-protobuf","version":"3.25.2","platform":"x86_64-linux","checksum":"95dec88caf1caab1aa3810c9e5d98fbbb6359d27024d13403b0583b592436cd4"}, +{"name":"google-protobuf","version":"3.25.3","platform":"aarch64-linux","checksum":"5ea9d20d60e5d3bef8d881b426946345e5ac6cf4779ac81cd900e45f40567243"}, +{"name":"google-protobuf","version":"3.25.3","platform":"arm64-darwin","checksum":"c42cddd21c4f09fd756fe0efd70ab6c8006dd67ffbb04e99fe7310f49923d18c"}, +{"name":"google-protobuf","version":"3.25.3","platform":"java","checksum":"5790f115de6a61adf80c9ba4d238f4a8ca43e56c879c35d98f56c153a04d49b6"}, +{"name":"google-protobuf","version":"3.25.3","platform":"ruby","checksum":"39bd97cbc7631905e76cdf8f1bf3dda1c3d05200d7e23f575aced78930fbddd6"}, +{"name":"google-protobuf","version":"3.25.3","platform":"x64-mingw-ucrt","checksum":"23f667eda9a2f8e4ade886015bdd6bf769dbec9619fec816f6b6df46c8bf7a3a"}, +{"name":"google-protobuf","version":"3.25.3","platform":"x64-mingw32","checksum":"4b63561bb4809f675601cf585158b4a5a4ff7ab5179051c6b7119b98cde9800e"}, +{"name":"google-protobuf","version":"3.25.3","platform":"x86-linux","checksum":"7a0e74f14affbce6024595cdb55e7e8c5a51716f0bb11b103c63cbe3a3a0e348"}, +{"name":"google-protobuf","version":"3.25.3","platform":"x86-mingw32","checksum":"f513007357656b9772d49f61b4d5818f7b958965f3129a28a2361e62c32281fe"}, +{"name":"google-protobuf","version":"3.25.3","platform":"x86_64-darwin","checksum":"13d27e96e89835f642c444e32414fd50fabc29a125d78760ad067d6536214f02"}, +{"name":"google-protobuf","version":"3.25.3","platform":"x86_64-linux","checksum":"ceeba879d9313a2bd0600a97d6fe3cf529a9b37d12ca026f891996c118b7ffb2"}, {"name":"googleapis-common-protos","version":"1.4.0","platform":"ruby","checksum":"da2380fb5ab1563580816c74e8d684ac17512c3654c829a3ee84f6d6139de382"}, {"name":"googleapis-common-protos-types","version":"1.5.0","platform":"ruby","checksum":"5769cf7376abc86ef7f5897a4aaca1d5c5a3c49ddabeddd2c251fcf8155f858b"}, {"name":"googleauth","version":"1.8.1","platform":"ruby","checksum":"814adadaaa1221dce72a67131e3ecbd6d23491a161ec84fb15fd353b87d8c9e7"}, diff --git a/Gemfile.lock b/Gemfile.lock index fcc61ec94ab..cd8f19ffab9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -311,10 +311,11 @@ GEM aws-sdk-cloudformation (1.41.0) aws-sdk-core (~> 3, >= 3.99.0) aws-sigv4 (~> 1.1) - aws-sdk-core (3.191.1) + aws-sdk-core (3.191.2) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) + base64 jmespath (~> 1, >= 1.6.1) aws-sdk-kms (1.76.0) aws-sdk-core (~> 3, >= 3.188.0) @@ -828,7 +829,7 @@ GEM google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - google-protobuf (3.25.2) + google-protobuf (3.25.3) googleapis-common-protos (1.4.0) google-protobuf (~> 3.14) googleapis-common-protos-types (~> 1.2) @@ -1838,7 +1839,7 @@ DEPENDENCIES autoprefixer-rails (= 10.2.5.1) awesome_print aws-sdk-cloudformation (~> 1) - aws-sdk-core (~> 3.191.1) + aws-sdk-core (~> 3.191.2) aws-sdk-s3 (~> 1.143.0) axe-core-rspec (~> 4.8.0) babosa (~> 2.0) @@ -1950,7 +1951,7 @@ DEPENDENCIES google-cloud-artifact_registry-v1 (~> 0.11.0) google-cloud-compute-v1 (~> 2.6.0) google-cloud-storage (~> 1.45.0) - google-protobuf (~> 3.25, >= 3.25.1) + google-protobuf (~> 3.25, >= 3.25.3) googleauth (~> 1.8.1) gpgme (~> 2.0.23) grape (~> 2.0.0) @@ -2152,4 +2153,4 @@ DEPENDENCIES yajl-ruby (~> 1.4.3) BUNDLED WITH - 2.5.5 + 2.5.6 diff --git a/config/initializers/7_redis.rb b/config/initializers/7_redis.rb index fbd2cbaabad..72f5574334d 100644 --- a/config/initializers/7_redis.rb +++ b/config/initializers/7_redis.rb @@ -30,6 +30,7 @@ Redis::Cluster.prepend(Gitlab::Patch::RedisCluster) # this only instruments `RedisClient` used in `Sidekiq.redis` RedisClient.register(Gitlab::Instrumentation::RedisClientMiddleware) RedisClient.prepend(Gitlab::Patch::RedisClient) +RedisClient::SentinelConfig.prepend(Gitlab::Patch::RedisClientSentinelConfig) if Gitlab::Redis::Workhorse.params[:cluster].present? raise "Do not configure workhorse with a Redis Cluster as pub/sub commands are not cluster-compatible." diff --git a/lib/gitlab/patch/redis_client_sentinel_config.rb b/lib/gitlab/patch/redis_client_sentinel_config.rb new file mode 100644 index 00000000000..f1a6a02214e --- /dev/null +++ b/lib/gitlab/patch/redis_client_sentinel_config.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +if Gem::Version.new(RedisClient::VERSION) != Gem::Version.new('0.20.0') + raise 'New version of redis-client detected, please remove or update this patch' +end + +module Gitlab + module Patch + module RedisClientSentinelConfig + # we manually apply the fix in + # https://github.com/redis-rb/redis-client/commit/26d355441f5b455294de887397ed8bea2e2c7275 + # until a new tag is released + def each_sentinel + last_error = nil + # rubocop:disable Gitlab/ModuleWithInstanceVariables -- Directly references code in redis-client gem + @sentinel_configs.dup.each do |sentinel_config| + sentinel_client = sentinel_client(sentinel_config) + success = true + begin + yield sentinel_client + rescue RedisClient::Error => error + last_error = error + success = false + sleep SENTINEL_DELAY + ensure + @sentinel_configs.unshift(@sentinel_configs.delete(sentinel_config)) if success + # Redis Sentinels may be configured to have a lower maxclients setting than + # the Redis nodes. Close the connection to the Sentinel node to avoid using + # a connection. + sentinel_client.close + # rubocop:enable Gitlab/ModuleWithInstanceVariables + end + end + end + end + end +end