mediocregopher / radix.v2

Redis client for Go
http://godoc.org/github.com/mediocregopher/radix.v2
MIT License
433 stars 92 forks source link

fix connection leak problem when using cluster #73

Closed kevwan closed 6 years ago

kevwan commented 6 years ago

On reseting the connection pools, the same addr(ip:port) might be created multiple times, and only the last one is used. The formers are discarded.

I'm doing checks before creating new pools.

Thanks!

mediocregopher commented 6 years ago

wow good catch! just to confirm I understand this right, this leak would occur if the same instance was handling two non-contiguous slot ranges, right? Then CLUSTER SLOTS would return an entry for each slot range, the second being the same ip:port as the previous?

kevwan commented 6 years ago

Yes, that's right!

One ip:port might handle many slots.

Regards, Kevin

mediocregopher commented 6 years ago

Sorry that took so long, been in the process of moving. Thanks again for the PR!