feat(failover): share the request breaker through Redis

The request breaker now also reads and writes the fleet breaker when redis.sharedState is on. A pod that sees enough failures opens the breaker for every pod after one refresh. A success on any pod closes it again. With the switch off, the tracker runs its local code only and makes no store call.
This commit is contained in:
2026-11-26 03:26:39 +00:00
parent 807cc6ee75
commit a46058694b
6 changed files with 187 additions and 7 deletions
+13
View File
@@ -0,0 +1,13 @@
package traefikllmgateway
// wireSharedState layers fleet-wide state over the local trackers. It is a no-op without a shared-state loop.
func (g *Gateway) wireSharedState(cfg *Config) {
if g.sharedState == nil {
return
}
ids := sharedStateIDs(cfg)
if g.failoverHealth != nil {
g.failoverHealth.share(newSharedBreaker(g.sharedState, sharedKindRequest, ids,
requestBreakerFailureThreshold, requestBreakerOpenDuration, requestBreakerMaxOpenDuration, 2*requestBreakerMaxOpenDuration))
}
}