docs(shared-state): state what the discovery threshold counts

With sharedState on, breaker.failureThreshold counts failed refreshes
across all route instances and replicas. It no longer counts three in a
row on one instance. The README and the wiring comment now say so.
This commit is contained in:
2026-11-26 04:15:29 +00:00
parent 19c6cfed03
commit 8e756c064d
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -20,6 +20,8 @@ func (g *Gateway) wireSharedState(cfg *Config) {
if err != nil {
brk = breakerConfig{failureThreshold: defaultBreakerFailureThreshold, openBase: defaultBreakerOpenDuration, openMax: defaultBreakerMaxOpenDuration}
}
// With a shared breaker, brk.failureThreshold counts failed refreshes across all route instances and replicas
// inside 2*openMax, not consecutive failures on one instance.
g.registry.shareBreaker(newSharedBreaker(g.sharedState, sharedKindDiscovery, ids,
brk.failureThreshold, brk.openBase, brk.openMax, 2*brk.openMax))
}