Skip to content

Commit

Permalink
Adding a debug message to indicate that the metadata was dropped in c…
Browse files Browse the repository at this point in the history
…ase this happens
  • Loading branch information
tishun committed Apr 9, 2024
1 parent 5dffa53 commit 9e9483a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/io/lettuce/core/RedisHandshake.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import io.lettuce.core.protocol.ConnectionInitializer;
import io.lettuce.core.protocol.ProtocolVersion;
import io.netty.channel.Channel;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;

/**
* Redis RESP2/RESP3 handshake using the configured {@link ProtocolVersion} and other options for connection initialization and
Expand All @@ -49,7 +51,7 @@
*/
class RedisHandshake implements ConnectionInitializer {

private static final RedisVersion CLIENT_SET_INFO_SINCE = RedisVersion.of("7.2");
private static final InternalLogger LOG = InternalLoggerFactory.getInstance(RedisHandshake.class);

private final RedisCommandBuilder<String, String> commandBuilder = new RedisCommandBuilder<>(StringCodec.UTF8);

Expand Down Expand Up @@ -106,7 +108,12 @@ public CompletionStage<Void> initialize(Channel channel) {
// post-handshake commands, executed in a 'fire and forget' manner, to avoid having to react to different
// implementations or versions of the server runtime, and whose execution result (whether a success or a
// failure ) should not alter the outcome of the connection attempt
CompletableFuture<Void> connectionMetadata = applyConnectionMetadata(channel).handle((result, error) -> null);
CompletableFuture<Void> connectionMetadata = applyConnectionMetadata(channel).handle((result, error) -> {
if (error != null) {
LOG.debug("Error applying connection metadata", error);
}
return null;
});

return handshake.thenCompose(ignore -> postHandshake).thenCompose(ignore -> connectionMetadata);
}
Expand Down

0 comments on commit 9e9483a

Please sign in to comment.