fix(shared-state): count discovery failures per instance

With redis.sharedState on, every route instance added each failed
discovery refresh to one fleet count. One failed round across the
fleet could then open the discovery breaker.

Each instance now counts its own consecutive failures. Only the
instance whose own count reaches breaker.failureThreshold shares a
trip, and the fleet breaker opens on the first trip.
This commit is contained in:
2026-11-26 06:21:10 +00:00
parent 00bb36d29d
commit ebe38e7527
5 changed files with 36 additions and 7 deletions
+2
View File
@@ -28,6 +28,8 @@ const (
sharedInflightPrefix = "llmgw:inf:"
sharedBreakerOpensTTLFactor = 4
// sharedDiscoveryFleetThreshold is the fleet count of instance trips that opens the discovery breaker.
sharedDiscoveryFleetThreshold = 1
sharedBreakerMaxDoublings = 30
// sharedBreakerKeysPerID counts the keys keys() lists per id: open, fails, opens.
sharedBreakerKeysPerID = 3