Improve Redis failure modes (#29405)
While investigating code paths during Redis downtime, I found out that the library by default retries indefinitely for read commmands. This leads to it being stuck in a loop while trying to read anything from Redis. We fix that by disabling retry. Secondly, we adjust the ConnWriteTimeout value slightly from its default of 10s which is a bit too high for normal working conditions. Ref: https://github.com/redis/rueidis/issues/680 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3c6d5f2d47
Коммит
833578741d
3
server/platform/services/cache/provider.go
поставляемый
3
server/platform/services/cache/provider.go
поставляемый
@@ -100,6 +100,9 @@ func NewRedisProvider(opts *RedisOptions) (Provider, error) {
|
||||
// meant to be used at very high scales. The docs suggest 20us,
|
||||
// but going as high as 250us doesn't make any material difference.
|
||||
MaxFlushDelay: 250 * time.Microsecond,
|
||||
DisableRetry: true,
|
||||
// The default is 10s, which is a bit too high
|
||||
ConnWriteTimeout: 5 * time.Second,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Ссылка в новой задаче
Block a user