Skip to content

Commit

Permalink
Do not suspend auto reconnect on protected mode #2770
Browse files Browse the repository at this point in the history
We now no longer suspend auto-reconnect when a connection encounters protected mode.
  • Loading branch information
mp911de committed Mar 5, 2024
1 parent faffc7e commit bb9cd0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/lettuce/core/protocol/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -884,12 +884,12 @@ private void onProtectedMode(String message) {

endpoint.notifyException(exception);

stack.forEach(cmd -> cmd.completeExceptionally(exception));
stack.clear();

if (channel != null) {
channel.disconnect();
}

stack.forEach(cmd -> cmd.completeExceptionally(exception));
stack.clear();
}

/**
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/io/lettuce/core/protocol/DefaultEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -518,12 +518,6 @@ public void notifyException(Throwable t) {
if (t instanceof RedisConnectionException && RedisConnectionException.isProtectedMode(t.getMessage())) {

connectionError = t;

if (connectionWatchdog != null) {
connectionWatchdog.setListenOnChannelInactive(false);
connectionWatchdog.setReconnectSuspended(false);
}

doExclusive(this::drainCommands).forEach(cmd -> cmd.completeExceptionally(t));
}

Expand Down

0 comments on commit bb9cd0d

Please sign in to comment.