mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-15 04:18:03 +00:00
fix(cache): harden cache backends, resilience, recovery, and transports
- RESP -ERR no longer closes healthy conn / aborts batch; global cap replacement-aware - global health-check pass serialized (latent data race); MemoryMonitor via ResourceManager - token-exchange retry, open-circuit rejections counted as failures - TLS-posture matching transport reuse (no silent InsecureSkipVerify handoff)
This commit is contained in:
Vendored
+15
@@ -95,7 +95,15 @@ func (r *RedisBackend) Set(ctx context.Context, key string, value []byte, ttl ti
|
||||
return ErrBackendClosed
|
||||
}
|
||||
|
||||
// A NEGATIVE TTL means "already expired" (the stack's convention for a
|
||||
// value whose validity has passed). Previously ttl<=0 fell through to a
|
||||
// bare SET with no expiry, silently making the entry permanent. Zero here
|
||||
// is the documented "no expiry" contract (see SetManyNoTTL), so only
|
||||
// strictly-negative TTLs are skipped.
|
||||
prefixedKey := r.prefixKey(key)
|
||||
if ttl < 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Execute with retry logic
|
||||
return r.executeWithRetry(ctx, func(conn *RedisConn) error {
|
||||
@@ -450,6 +458,13 @@ func (r *RedisBackend) SetMany(ctx context.Context, items map[string][]byte, ttl
|
||||
return nil
|
||||
}
|
||||
|
||||
if ttl < 0 {
|
||||
// Already-expired TTL: nothing to persist (see Set's guard). Avoids
|
||||
// creating permanent entries for past-dated values via the multi path.
|
||||
// Zero retains the "no expiry" contract (see SetManyNoTTL).
|
||||
return nil
|
||||
}
|
||||
|
||||
// For single items, use regular Set
|
||||
if len(items) == 1 {
|
||||
for key, value := range items {
|
||||
|
||||
Reference in New Issue
Block a user