blob: 24fa4cf34b2324d8dcfe32470b79e24a92dcd48d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# frozen_string_literal: true
module Gitlab
module Patch
module RedisClient
# This patch resets the connection error tracker after each call to prevent state leak
# across calls and requests.
#
# The purpose of the tracker is to silence RedisClient::ConnectionErrors during reconnection attempts.
# More details found in https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/2564#note_1665334335
def ensure_connected(retryable: true)
super
ensure
Thread.current[:redis_client_error_count] = 0
end
end
end
end
|