Skip to content

Commit 05b6755

Browse files
committed
fix: 🐛 Redis Cluster Refresh
fix issue that redis cluster list would not refresh if a host was lost
1 parent 052cddf commit 05b6755

File tree

9 files changed

+34
-24
lines changed

9 files changed

+34
-24
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ subprojects {
6262
implementation "com.mx.path-core:common"
6363
testImplementation "com.mx.path-core:testing"
6464
testImplementation "org.junit.jupiter:junit-jupiter-api:[5.9.0,5.10.0)"
65+
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
66+
6567
}
6668

6769
test { useJUnitPlatform() }

encryption-service-jasypt/gradle.lockfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ org.antlr:antlr4-runtime:4.7.2=pmd
6363
org.antlr:antlr4-runtime:4.8-1=checkstyle
6464
org.apache.bcel:bcel:6.6.1=spotbugs
6565
org.apache.commons:commons-lang3:3.13.0=spotbugs
66-
org.apache.commons:commons-lang3:3.17.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
66+
org.apache.commons:commons-lang3:3.18.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
6767
org.apache.commons:commons-lang3:3.8.1=pmd
6868
org.apache.commons:commons-text:1.10.0=spotbugs
69-
org.apache.commons:commons-text:1.13.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
69+
org.apache.commons:commons-text:1.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
7070
org.apache.groovy:groovy-bom:4.0.26=testCompileClasspath,testRuntimeClasspath
7171
org.apache.groovy:groovy:4.0.26=testCompileClasspath,testRuntimeClasspath
7272
org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs
@@ -94,6 +94,7 @@ org.junit.jupiter:junit-jupiter-api:5.12.2=testCompileClasspath,testRuntimeClass
9494
org.junit.jupiter:junit-jupiter-engine:5.12.2=testRuntimeClasspath
9595
org.junit.platform:junit-platform-commons:1.12.2=testCompileClasspath,testRuntimeClasspath
9696
org.junit.platform:junit-platform-engine:1.12.2=testCompileClasspath,testRuntimeClasspath
97+
org.junit.platform:junit-platform-launcher:1.12.2=testRuntimeClasspath
9798
org.junit:junit-bom:5.12.2=testCompileClasspath,testRuntimeClasspath
9899
org.junit:junit-bom:5.9.0=runtimeClasspath
99100
org.mockito:mockito-core:4.11.0=testCompileClasspath,testRuntimeClasspath

encryption-service-vault/gradle.lockfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ org.antlr:antlr4-runtime:4.7.2=pmd
6565
org.antlr:antlr4-runtime:4.8-1=checkstyle
6666
org.apache.bcel:bcel:6.6.1=spotbugs
6767
org.apache.commons:commons-lang3:3.13.0=spotbugs
68-
org.apache.commons:commons-lang3:3.17.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
68+
org.apache.commons:commons-lang3:3.18.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
6969
org.apache.commons:commons-lang3:3.8.1=pmd
7070
org.apache.commons:commons-text:1.10.0=spotbugs
71-
org.apache.commons:commons-text:1.13.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
71+
org.apache.commons:commons-text:1.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
7272
org.apache.groovy:groovy-bom:4.0.26=testCompileClasspath,testRuntimeClasspath
7373
org.apache.groovy:groovy:4.0.26=testCompileClasspath,testRuntimeClasspath
7474
org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs
@@ -95,6 +95,7 @@ org.junit.jupiter:junit-jupiter-api:5.12.2=testCompileClasspath,testRuntimeClass
9595
org.junit.jupiter:junit-jupiter-engine:5.12.2=testRuntimeClasspath
9696
org.junit.platform:junit-platform-commons:1.12.2=testCompileClasspath,testRuntimeClasspath
9797
org.junit.platform:junit-platform-engine:1.12.2=testCompileClasspath,testRuntimeClasspath
98+
org.junit.platform:junit-platform-launcher:1.12.2=testRuntimeClasspath
9899
org.junit:junit-bom:5.12.2=testCompileClasspath,testRuntimeClasspath
99100
org.junit:junit-bom:5.9.0=runtimeClasspath
100101
org.mockito:mockito-core:4.11.0=testCompileClasspath,testRuntimeClasspath

exception-reporter-honeybadger/gradle.lockfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ org.antlr:antlr4-runtime:4.7.2=pmd
7575
org.antlr:antlr4-runtime:4.8-1=checkstyle
7676
org.apache.bcel:bcel:6.6.1=spotbugs
7777
org.apache.commons:commons-lang3:3.13.0=spotbugs
78-
org.apache.commons:commons-lang3:3.17.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
78+
org.apache.commons:commons-lang3:3.18.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
7979
org.apache.commons:commons-lang3:3.8.1=pmd
8080
org.apache.commons:commons-text:1.10.0=spotbugs
81-
org.apache.commons:commons-text:1.13.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
81+
org.apache.commons:commons-text:1.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
8282
org.apache.groovy:groovy-bom:4.0.26=testCompileClasspath,testRuntimeClasspath
8383
org.apache.groovy:groovy:4.0.26=testCompileClasspath,testRuntimeClasspath
8484
org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs
@@ -106,6 +106,7 @@ org.junit.jupiter:junit-jupiter-api:5.12.2=testCompileClasspath,testRuntimeClass
106106
org.junit.jupiter:junit-jupiter-engine:5.12.2=testRuntimeClasspath
107107
org.junit.platform:junit-platform-commons:1.12.2=testCompileClasspath,testRuntimeClasspath
108108
org.junit.platform:junit-platform-engine:1.12.2=testCompileClasspath,testRuntimeClasspath
109+
org.junit.platform:junit-platform-launcher:1.12.2=testRuntimeClasspath
109110
org.junit:junit-bom:5.12.2=testCompileClasspath,testRuntimeClasspath
110111
org.junit:junit-bom:5.9.0=runtimeClasspath
111112
org.mockito:mockito-core:3.4.6=compileClasspath,runtimeClasspath

fault-tolerant-executor-resilience4j/gradle.lockfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ org.antlr:antlr4-runtime:4.7.2=pmd
7272
org.antlr:antlr4-runtime:4.8-1=checkstyle
7373
org.apache.bcel:bcel:6.6.1=spotbugs
7474
org.apache.commons:commons-lang3:3.13.0=spotbugs
75-
org.apache.commons:commons-lang3:3.17.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
75+
org.apache.commons:commons-lang3:3.18.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
7676
org.apache.commons:commons-lang3:3.8.1=pmd
7777
org.apache.commons:commons-text:1.10.0=spotbugs
78-
org.apache.commons:commons-text:1.13.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
78+
org.apache.commons:commons-text:1.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
7979
org.apache.groovy:groovy-bom:4.0.26=testCompileClasspath,testRuntimeClasspath
8080
org.apache.groovy:groovy:4.0.26=testCompileClasspath,testRuntimeClasspath
8181
org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs
@@ -102,6 +102,7 @@ org.junit.jupiter:junit-jupiter-api:5.12.2=testCompileClasspath,testRuntimeClass
102102
org.junit.jupiter:junit-jupiter-engine:5.12.2=testRuntimeClasspath
103103
org.junit.platform:junit-platform-commons:1.12.2=testCompileClasspath,testRuntimeClasspath
104104
org.junit.platform:junit-platform-engine:1.12.2=testCompileClasspath,testRuntimeClasspath
105+
org.junit.platform:junit-platform-launcher:1.12.2=testRuntimeClasspath
105106
org.junit:junit-bom:5.12.2=testCompileClasspath,testRuntimeClasspath
106107
org.junit:junit-bom:5.9.0=runtimeClasspath
107108
org.mockito:mockito-core:4.11.0=testCompileClasspath,testRuntimeClasspath

message-broker-nats/gradle.lockfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ org.antlr:antlr4-runtime:4.7.2=pmd
6666
org.antlr:antlr4-runtime:4.8-1=checkstyle
6767
org.apache.bcel:bcel:6.6.1=spotbugs
6868
org.apache.commons:commons-lang3:3.13.0=spotbugs
69-
org.apache.commons:commons-lang3:3.17.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
69+
org.apache.commons:commons-lang3:3.18.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
7070
org.apache.commons:commons-lang3:3.8.1=pmd
7171
org.apache.commons:commons-text:1.10.0=spotbugs
72-
org.apache.commons:commons-text:1.13.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
72+
org.apache.commons:commons-text:1.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
7373
org.apache.groovy:groovy-bom:4.0.26=testCompileClasspath,testRuntimeClasspath
7474
org.apache.groovy:groovy:4.0.26=testCompileClasspath,testRuntimeClasspath
7575
org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs
@@ -99,6 +99,7 @@ org.junit.jupiter:junit-jupiter-api:5.12.2=testCompileClasspath,testRuntimeClass
9999
org.junit.jupiter:junit-jupiter-engine:5.12.2=testRuntimeClasspath
100100
org.junit.platform:junit-platform-commons:1.12.2=testCompileClasspath,testRuntimeClasspath
101101
org.junit.platform:junit-platform-engine:1.12.2=testCompileClasspath,testRuntimeClasspath
102+
org.junit.platform:junit-platform-launcher:1.12.2=testRuntimeClasspath
102103
org.junit:junit-bom:5.12.2=testCompileClasspath,testRuntimeClasspath
103104
org.junit:junit-bom:5.9.0=runtimeClasspath
104105
org.mockito:mockito-core:4.11.0=testCompileClasspath,testRuntimeClasspath

store-redis/gradle.lockfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ info.picocli:picocli:4.1.4=checkstyle
4646
io.github.cdimascio:dotenv-java:2.3.2=testRuntimeClasspath
4747
io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath
4848
io.lettuce:lettuce-core:6.2.0.RELEASE=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
49-
io.netty:netty-buffer:4.1.123.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
50-
io.netty:netty-codec:4.1.123.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
51-
io.netty:netty-common:4.1.123.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
52-
io.netty:netty-handler:4.1.123.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
53-
io.netty:netty-resolver:4.1.123.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
54-
io.netty:netty-transport-native-unix-common:4.1.123.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
55-
io.netty:netty-transport:4.1.123.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
49+
io.netty:netty-buffer:4.1.128.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
50+
io.netty:netty-codec:4.1.128.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
51+
io.netty:netty-common:4.1.128.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
52+
io.netty:netty-handler:4.1.128.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
53+
io.netty:netty-resolver:4.1.128.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
54+
io.netty:netty-transport-native-unix-common:4.1.128.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
55+
io.netty:netty-transport:4.1.128.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
5656
io.opentracing:opentracing-api:0.33.0=testRuntimeClasspath
5757
io.opentracing:opentracing-noop:0.33.0=testRuntimeClasspath
5858
io.opentracing:opentracing-util:0.33.0=testRuntimeClasspath
@@ -73,10 +73,10 @@ org.antlr:antlr4-runtime:4.7.2=pmd
7373
org.antlr:antlr4-runtime:4.8-1=checkstyle
7474
org.apache.bcel:bcel:6.6.1=spotbugs
7575
org.apache.commons:commons-lang3:3.13.0=spotbugs
76-
org.apache.commons:commons-lang3:3.17.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
76+
org.apache.commons:commons-lang3:3.18.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
7777
org.apache.commons:commons-lang3:3.8.1=pmd
7878
org.apache.commons:commons-text:1.10.0=spotbugs
79-
org.apache.commons:commons-text:1.13.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
79+
org.apache.commons:commons-text:1.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
8080
org.apache.groovy:groovy-bom:4.0.26=testCompileClasspath,testRuntimeClasspath
8181
org.apache.groovy:groovy:4.0.26=testCompileClasspath,testRuntimeClasspath
8282
org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs
@@ -103,6 +103,7 @@ org.junit.jupiter:junit-jupiter-api:5.12.2=testCompileClasspath,testRuntimeClass
103103
org.junit.jupiter:junit-jupiter-engine:5.12.2=testRuntimeClasspath
104104
org.junit.platform:junit-platform-commons:1.12.2=testCompileClasspath,testRuntimeClasspath
105105
org.junit.platform:junit-platform-engine:1.12.2=testCompileClasspath,testRuntimeClasspath
106+
org.junit.platform:junit-platform-launcher:1.12.2=testRuntimeClasspath
106107
org.junit:junit-bom:5.12.2=testCompileClasspath,testRuntimeClasspath
107108
org.junit:junit-bom:5.9.0=runtimeClasspath
108109
org.mockito:mockito-core:4.11.0=testCompileClasspath,testRuntimeClasspath

store-redis/src/main/java/com/mx/path/service/facility/store/redis/RedisStore.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
import java.io.File;
44
import java.time.Duration;
55
import java.util.Set;
6-
import java.util.concurrent.TimeUnit;
76
import java.util.function.Function;
87

9-
import io.lettuce.core.cluster.ClusterTopologyRefreshOptions;
108
import lombok.Getter;
119

1210
import com.mx.path.core.common.configuration.Configuration;
@@ -19,6 +17,7 @@
1917
import io.lettuce.core.SslOptions;
2018
import io.lettuce.core.api.StatefulRedisConnection;
2119
import io.lettuce.core.cluster.ClusterClientOptions;
20+
import io.lettuce.core.cluster.ClusterTopologyRefreshOptions;
2221
import io.lettuce.core.cluster.RedisClusterClient;
2322
import io.lettuce.core.cluster.api.StatefulRedisClusterConnection;
2423
import io.lettuce.core.protocol.ProtocolVersion;
@@ -31,6 +30,8 @@ public class RedisStore implements Store {
3130

3231
private static final String PUT_UNSUPPORTED_OPERATION = "Put operations must have an expiration";
3332

33+
private static final long REDIS_REFRESH_INTERVAL = 3;
34+
3435
@Getter
3536
private final RedisStoreConfiguration configuration;
3637
@Getter
@@ -227,7 +228,7 @@ final synchronized StatefulRedisClusterConnection<String, String> buildClusterCo
227228

228229
RedisClusterClient redisClusterClient = RedisClusterClient.create(resources, redisUri);
229230
ClusterTopologyRefreshOptions topologyRefreshOptions = ClusterTopologyRefreshOptions.builder()
230-
.enablePeriodicRefresh(Duration.ofMinutes(3))
231+
.enablePeriodicRefresh(Duration.ofMinutes(REDIS_REFRESH_INTERVAL))
231232
.enableAllAdaptiveRefreshTriggers()
232233
.build();
233234
SslOptions sslOptions = SslOptions.builder()

store-vault/gradle.lockfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ org.antlr:antlr4-runtime:4.7.2=pmd
6565
org.antlr:antlr4-runtime:4.8-1=checkstyle
6666
org.apache.bcel:bcel:6.6.1=spotbugs
6767
org.apache.commons:commons-lang3:3.13.0=spotbugs
68-
org.apache.commons:commons-lang3:3.17.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
68+
org.apache.commons:commons-lang3:3.18.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
6969
org.apache.commons:commons-lang3:3.8.1=pmd
7070
org.apache.commons:commons-text:1.10.0=spotbugs
71-
org.apache.commons:commons-text:1.13.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
71+
org.apache.commons:commons-text:1.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
7272
org.apache.groovy:groovy-bom:4.0.26=testCompileClasspath,testRuntimeClasspath
7373
org.apache.groovy:groovy:4.0.26=testCompileClasspath,testRuntimeClasspath
7474
org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs
@@ -95,6 +95,7 @@ org.junit.jupiter:junit-jupiter-api:5.12.2=testCompileClasspath,testRuntimeClass
9595
org.junit.jupiter:junit-jupiter-engine:5.12.2=testRuntimeClasspath
9696
org.junit.platform:junit-platform-commons:1.12.2=testCompileClasspath,testRuntimeClasspath
9797
org.junit.platform:junit-platform-engine:1.12.2=testCompileClasspath,testRuntimeClasspath
98+
org.junit.platform:junit-platform-launcher:1.12.2=testRuntimeClasspath
9899
org.junit:junit-bom:5.12.2=testCompileClasspath,testRuntimeClasspath
99100
org.junit:junit-bom:5.9.0=runtimeClasspath
100101
org.mockito:mockito-core:4.11.0=testCompileClasspath,testRuntimeClasspath

0 commit comments

Comments
 (0)