Skip to content

Commit 090aef1

Browse files
committed
Describe why we skip zero address
1 parent 2bf6581 commit 090aef1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rediscluster/redisclusterutil/cluster.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ func ParseSlotsInfo(res interface{}) ([]SlotsRange, error) {
7878
host, hasHost := rawaddr[0].([]byte)
7979
port, hasPort := rawaddr[1].(int64)
8080
if !hasHost && hasPort && port == 0 {
81-
// fallback to skip zero address
81+
// Due to possible Redis cluster misconfiguration we can receive zero address
82+
// for one of the replicas. It is totally fine to skip the misconfigured replica
83+
// and go with the remaining ones without inducing denial of service.
8284
arr, isArray := rawaddr[0].([]interface{})
8385
if isArray && len(arr) == 0 {
8486
continue

0 commit comments

Comments
 (0)