Add support for configuring Redis client timeouts
What does this MR do?
For some installations, the default 1-second Redis connect timeout may
not sufficient. Just as PostgreSQL has the ability to configure
connectTimeout
, add the same for Redis. Add read and write timeouts
for completness.
Related issues
Relates to gitlab-org/gitlab#466271
Also see https://gitlab.com/gitlab-com/ops-sub-department/section-ops-request-for-help/-/issues/189.
Author checklist
For general guidance, please follow our Contributing guide.
Testing
- Leave the
global.redis.connectTimeout
as the default. - Deploy the cluster.
- Check
/srv/gitlab/config/resque.yml
it has the config. - In
/srv/gitlab
, runbin/rails console
. - To check that the Redis client is using this timeout:
Sidekiq.redis { |redis| redis.config.inspect }
Gitlab::Redis::Cache.with { |redis| puts redis.instance_variable_get(:@client).config.inspect }
- Update the settings:
global:
redis:
connectTimeout: 3
readTimeout: 4
writeTimeout: 5
Repeat steps 2-5.
Required
For anything in this list which will not be completed, please provide a reason in the MR discussion.
-
Merge Request Title and Description are up to date, accurate, and descriptive. -
MR targeting the appropriate branch. -
MR has a green pipeline. -
Documentation created/updated. -
Tests added/updated, and test plan for scenarios not covered by automated tests. -
Equivalent MR/issue for omnibus-gitlab opened: gitlab-org/omnibus-gitlab!7749 (merged)
Reviewers checklist
-
MR has a green pipeline on https://gitlab.com/gitlab-org/charts/gitlab. -
Consider downstream impact to the Operator, as per evaluating impact from changes to GitLab Chart.
Edited by João Alexandre Cunha