mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
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:
@@ -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))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user