Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions docs/failover.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ Then build a `MultiClusterPooledConnectionProvider`.

```java
MultiClusterClientConfig.Builder builder = new MultiClusterClientConfig.Builder(clientConfigs);
builder.circuitBreakerSlidingWindowSize(10); // Sliding window size in number of calls
builder.circuitBreakerSlidingWindowMinCalls(1);
builder.circuitBreakerFailureRateThreshold(50.0f); // percentage of failures to trigger circuit breaker
builder.circuitBreakerSlidingWindowSize(2); // Sliding window size in number of calls
builder.circuitBreakerFailureRateThreshold(10.0f); // percentage of failures to trigger circuit breaker

builder.failbackSupported(true); // Enable failback
builder.failbackCheckInterval(1000); // Check every second the unhealthy cluster to see if it has recovered
Expand Down Expand Up @@ -140,12 +139,9 @@ Jedis uses the following circuit breaker settings:

| Setting | Default value | Description |
|-----------------------------------------|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Sliding window type | `COUNT_BASED` | The type of sliding window used to record the outcome of calls. Options are `COUNT_BASED` and `TIME_BASED`. |
| Sliding window size | 100 | The size of the sliding window. Units depend on sliding window type. When `COUNT_BASED`, the size represents number of calls. When `TIME_BASED`, the size represents seconds. |
| Sliding window min calls | 100 | Minimum number of calls required (per sliding window period) before the CircuitBreaker will start calculating the error rate or slow call rate. |
| Failure rate threshold | `50.0f` | Percentage of calls within the sliding window that must fail before the circuit breaker transitions to the `OPEN` state. |
| Slow call duration threshold | 60000 ms | Duration threshold above which calls are classified as slow and added to the sliding window. |
| Slow call rate threshold | `100.0f` | Percentage of calls within the sliding window that exceed the slow call duration threshold before circuit breaker transitions to the `OPEN` state. |
| Sliding window size | 2 | The size of the sliding window. Units depend on sliding window type. The size represents seconds. |
| Threshold min number of failures | 1000 | Minimum number of failures before circuit breaker is tripped. |
| Failure rate threshold | `10.0f` | Percentage of calls within the sliding window that must fail before the circuit breaker transitions to the `OPEN` state. |
| Circuit breaker included exception list | [JedisConnectionException] | A list of Throwable classes that count as failures and add to the failure rate. |
| Circuit breaker ignored exception list | null | A list of Throwable classes to explicitly ignore for failure rate calculations. | |

Expand Down
17 changes: 7 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
<junit.version>5.13.4</junit.version>
<!-- Default JVM options for tests -->
<JVM_OPTS></JVM_OPTS>
<!-- Default excluded groups for tests - can be overridden from command line -->
<excludedGroupsForUnitTests>integration,scenario</excludedGroupsForUnitTests>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -335,7 +337,7 @@
<systemPropertyVariables>
<redis-hosts>${redis-hosts}</redis-hosts>
</systemPropertyVariables>
<excludedGroups>integration,scenario</excludedGroups>
<excludedGroups>${excludedGroupsForUnitTests}</excludedGroups>
<excludes>
<exclude>**/examples/*.java</exclude>
<exclude>**/scenario/*Test.java</exclude>
Expand Down Expand Up @@ -482,21 +484,16 @@
<include>**/Endpoint.java</include>
<include>src/main/java/redis/clients/jedis/mcf/*.java</include>
<include>src/test/java/redis/clients/jedis/failover/*.java</include>
<include>**/mcf/EchoStrategyIntegrationTest.java</include>
<include>**/mcf/LagAwareStrategyUnitTest.java</include>
<include>**/mcf/RedisRestAPI*.java</include>
<include>**/mcf/ActiveActiveLocalFailoverTest*</include>
<include>**/mcf/FailbackMechanism*.java</include>
<include>**/mcf/PeriodicFailbackTest*.java</include>
<include>**/mcf/AutomaticFailoverTest*.java</include>
<include>**/mcf/MultiCluster*.java</include>
<include>**/mcf/StatusTracker*.java</include>
<include>src/test/java/redis/clients/jedis/mcf/*.java</include>
<include>**/Health*.java</include>
<include>**/*IT.java</include>
<include>**/scenario/RestEndpointUtil.java</include>
<include>src/main/java/redis/clients/jedis/MultiClusterClientConfig.java</include>
<include>src/main/java/redis/clients/jedis/HostAndPort.java</include>
<include>**/builders/*.java</include>
<include>**/MultiDb*.java</include>
<include>**/ClientTestUtil.java</include>
<include>**/ReflectionTestUtil.java</include>
</includes>
</configuration>
<executions>
Expand Down
Loading
Loading