Skip to content

Commit

Permalink
Fixed - NPE is thrown by RedisExecutor.handleError() method. #5641
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Koksharov committed Feb 20, 2024
1 parent ebc3051 commit 8713829
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,10 @@ protected void onException() {

protected void handleError(CompletableFuture<RedisConnection> connectionFuture, Throwable cause) {
mainPromise.completeExceptionally(cause);
if (connectionFuture == null) {
return;
}

RedisClient client = connectionFuture.join().getRedisClient();
client.getConfig().getFailedNodeDetector().onCommandFailed(cause);
if (client.getConfig().getFailedNodeDetector().isNodeFailed()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ protected void handleError(CompletableFuture<RedisConnection> connectionFuture,
sentPromise.completeExceptionally(cause);
mainPromise.completeExceptionally(cause);
if (executed.compareAndSet(false, true)) {
if (connectionFuture == null) {
return;
}

RedisConnection c = getNow(connectionFuture);
if (c != null) {
c.forceFastReconnectAsync().whenComplete((res, e) -> {
Expand Down

0 comments on commit 8713829

Please sign in to comment.