if i use domain name to init the client instead of ip address, like this:
cluster, err := redis.NewCluster(
&redis.Options{
StartNodes: []string{"1xxx.com:7000", "2xxx.com:7001", "3xxx.com:7002"},
ConnTimeout: 50 * time.Millisecond,
ReadTimeout: 50 * time.Millisecond,
WriteTimeout: 50 * time.Millisecond,
KeepAlive: 16,
AliveTime: 60 * time.Second,
})
it will be panic when my application running, i find out the problem in this file:node.go.
if conn.c.RemoteAddr().String() != node.address {
panic("unreachable")
}
the result of "conn.c.RemoteAddr().String()" is ip address, but the return of node.address is domain name
Yes, it's really a bug. Maybe there's no need to check ip when release connection, I will first remove the check. If you have any problem, please let me know.
if i use domain name to init the client instead of ip address, like this: cluster, err := redis.NewCluster( &redis.Options{ StartNodes: []string{"1xxx.com:7000", "2xxx.com:7001", "3xxx.com:7002"}, ConnTimeout: 50 * time.Millisecond, ReadTimeout: 50 * time.Millisecond, WriteTimeout: 50 * time.Millisecond, KeepAlive: 16, AliveTime: 60 * time.Second, })
it will be panic when my application running, i find out the problem in this file:node.go. if conn.c.RemoteAddr().String() != node.address { panic("unreachable") }
the result of "conn.c.RemoteAddr().String()" is ip address, but the return of node.address is domain name