zitadel/internal/cache/connector/redis
Tim Möhlmann ee7beca61f
fix(cache): ignore NOSCRIPT errors in redis circuit breaker (#9022)
# Which Problems Are Solved

When Zitadel starts the first time with a configured Redis cache, the
circuit break would open on the first requests, with no explanatory
error and only log-lines explaining the state of the Circuit breaker.

Using a debugger, `NOSCRIPT No matching script. Please use EVAL.` was
found the be passed to `Limiter.ReportResult`. This error is actually
retried by go-redis after a
[`Script.Run`](https://pkg.go.dev/github.com/redis/go-redis/v9@v9.7.0#Script.Run):

> Run optimistically uses EVALSHA to run the script. If script does not
exist it is retried using EVAL.

# How the Problems Are Solved

Add the `NOSCRIPT` error prefix to the whitelist.

# Additional Changes

- none

# Additional Context

- Introduced in: https://github.com/zitadel/zitadel/pull/8890
- Workaround for: https://github.com/redis/go-redis/issues/3203
2024-12-09 08:20:21 +00:00
..
_remove.lua feat(cache): redis cache (#8822) 2024-11-04 10:44:51 +00:00
_select.lua feat(cache): redis cache (#8822) 2024-11-04 10:44:51 +00:00
_util.lua feat(cache): redis cache (#8822) 2024-11-04 10:44:51 +00:00
circuit_breaker_test.go feat(cache): redis circuit breaker (#8890) 2024-11-13 19:11:48 +01:00
circuit_breaker.go fix(cache): ignore NOSCRIPT errors in redis circuit breaker (#9022) 2024-12-09 08:20:21 +00:00
connector.go feat(cache): redis circuit breaker (#8890) 2024-11-13 19:11:48 +01:00
get.lua feat(cache): redis cache (#8822) 2024-11-04 10:44:51 +00:00
invalidate.lua feat(cache): redis cache (#8822) 2024-11-04 10:44:51 +00:00
redis_test.go feat(cache): redis circuit breaker (#8890) 2024-11-13 19:11:48 +01:00
redis.go feat(cache): redis cache (#8822) 2024-11-04 10:44:51 +00:00
set.lua feat(cache): redis cache (#8822) 2024-11-04 10:44:51 +00:00