Commit becc516c authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Set default reconnect_attempts of Rails.cache to 1

RedisCacheStore defaults to 0 but we need this to be 1 because
Redis connections need to reconnect after a fork so that forked
processes don't use the same socket

This problem was introduced when we switched to RedisCacheStore
because Rails explicitly sets the default to 0. The default value
in the redis client is 1.
parent b55a4a72
---
title: Fix CAS users being signed out repeatedly
merge_request: 22704
author:
type: fixed
......@@ -261,6 +261,10 @@ module Gitlab
caching_config_hash[:pool_timeout] = 1
end
# Overrides RedisCacheStore's default value of 0
# This makes the default value the same with Gitlab::Redis::Cache
caching_config_hash[:reconnect_attempts] ||= ::Redis::Client::DEFAULTS[:reconnect_attempts]
config.cache_store = :redis_cache_store, caching_config_hash
config.active_job.queue_adapter = :sidekiq
......
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