Skip to content

Commit

Permalink
Guard NodeTopologyView against absent INFO response #2035
Browse files Browse the repository at this point in the history
Lettuce now ignores when the INFO command completes exceptionally when obtaining a cluster topology and falls back to no-detail handling.
  • Loading branch information
mp911de committed Mar 16, 2022
1 parent 83962d1 commit 0c4e90c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private NodeTopologyView(RedisURI redisURI) {
this.available = true;
this.redisURI = redisURI;

Properties properties = parseInfo(info);
Properties properties = info == null ? new Properties() : parseInfo(info);
this.partitions = ClusterPartitionParser.parse(clusterNodes);
this.connectedClients = getClientCount(properties);
this.replicationOffset = getReplicationOffset(properties);
Expand All @@ -86,7 +86,7 @@ static NodeTopologyView from(RedisURI redisURI, Requests clusterNodesRequests, R
TimedAsyncCommand<String, String, String> nodes = clusterNodesRequests.getRequest(redisURI);
TimedAsyncCommand<String, String, String> info = infoRequests.getRequest(redisURI);

if (resultAvailable(nodes) && resultAvailable(info)) {
if (resultAvailable(nodes) && !nodes.isCompletedExceptionally() && resultAvailable(info)) {
return new NodeTopologyView(redisURI, nodes.join(), optionallyGet(info), nodes.duration());
}
return new NodeTopologyView(redisURI);
Expand Down

0 comments on commit 0c4e90c

Please sign in to comment.