docs(shared-state): describe the trip rule and the backoff reset

This commit is contained in:
2026-11-26 04:15:54 +00:00
parent 0852e59c09
commit 1e07c4b00f
+1 -1
View File
@@ -738,7 +738,7 @@ Traefik calls `New()` once per route and runs several pods. Without `redis.share
How it works:
- A breaker counts consecutive failures across all replicas. A success on any replica resets the count and closes an open breaker. The replica whose flush takes the count from below the threshold to the threshold or above opens the breaker for all replicas. Open times and thresholds are the local ones: 3 failures and 30 seconds, doubling to 5 minutes, for the request breaker; the `breaker` block for the discovery breaker; 3 failures and 30 seconds for the decision breaker.
- A breaker counts consecutive failures across all replicas. A success on any replica resets the count and closes an open breaker. A replica whose flush leaves the count at or above the threshold opens the breaker for all replicas, unless its last refresh already shows the breaker open. Two replicas can then open it at nearly the same time. A success also resets the doubling of the open time. Open times and thresholds are the local ones: 3 failures and 30 seconds, doubling to 5 minutes, for the request breaker; the `breaker` block for the discovery breaker; 3 failures and 30 seconds for the decision breaker.
- A breaker reads as open when its local breaker or the shared breaker is open.
- With `redis.sharedState` on, the discovery `breaker.failureThreshold` counts failed refreshes across every route instance of every replica, not consecutive failures on one instance. Each instance runs its own discovery loop and adds each failed refresh to the shared count. Any success on any instance resets the count. The count also expires after twice `breaker.maxOpenDuration`. With the default threshold of `3` and several instances, a single round of failed refreshes can open the shared breaker. Raise `failureThreshold` for a large fleet. The local breaker of each instance still counts consecutive failures on that instance.
- In-flight load is the larger of the local count and the shared count. The read window is the longest request timeout in 5 minute epochs, plus one epoch. A request stops counting when its start epoch leaves the window. A request timeout is progress-based: a stream that keeps sending data can run longer than the timeout. Such a stream drops out of the shared count when the window passes, so the shared count can be too low for long streams. It is never too high because of them.