Skip to content

Commit

Permalink
Describe why we skip zero address
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmsk committed Sep 18, 2024
1 parent 2bf6581 commit 090aef1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rediscluster/redisclusterutil/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ func ParseSlotsInfo(res interface{}) ([]SlotsRange, error) {
host, hasHost := rawaddr[0].([]byte)
port, hasPort := rawaddr[1].(int64)
if !hasHost && hasPort && port == 0 {
// fallback to skip zero address
// Due to possible Redis cluster misconfiguration we can receive zero address
// for one of the replicas. It is totally fine to skip the misconfigured replica
// and go with the remaining ones without inducing denial of service.
arr, isArray := rawaddr[0].([]interface{})
if isArray && len(arr) == 0 {
continue
Expand Down

0 comments on commit 090aef1

Please sign in to comment.