mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
feat(registry): share the discovery breaker through Redis
A provider whose discovery fails often enough now reads as unhealthy on every pod when redis.sharedState is on. The shared breaker uses the same threshold and open times as the local one. The discovered model sets stay local. With the switch off, the provider state runs its local code only and makes no store call.
This commit is contained in:
@@ -15,6 +15,14 @@ func (g *Gateway) wireSharedState(cfg *Config) {
|
||||
if g.concurrency != nil {
|
||||
g.concurrency.share(newSharedInflight(g.sharedState, ids, maxProviderTimeout(cfg)))
|
||||
}
|
||||
if g.registry != nil {
|
||||
brk, err := validateBreakerConfig(cfg.Breaker)
|
||||
if err != nil {
|
||||
brk = breakerConfig{failureThreshold: defaultBreakerFailureThreshold, openBase: defaultBreakerOpenDuration, openMax: defaultBreakerMaxOpenDuration}
|
||||
}
|
||||
g.registry.shareBreaker(newSharedBreaker(g.sharedState, sharedKindDiscovery, ids,
|
||||
brk.failureThreshold, brk.openBase, brk.openMax, 2*brk.openMax))
|
||||
}
|
||||
}
|
||||
|
||||
// maxProviderTimeout is the longest request timeout any provider can run, which bounds how long an in-flight count stays live.
|
||||
|
||||
Reference in New Issue
Block a user