Grokzen / redis-py-cluster

Python cluster client for the official redis cluster. Redis 3.0+.
https://redis-py-cluster.readthedocs.io/
MIT License
1.1k stars 315 forks source link

Parsing of redis url:s with database in it fails #456

Open Grokzen opened 3 years ago

Grokzen commented 3 years ago

If you pass in "redis://redis:6379/2" with a database parameter into the parse_url version in this lib it will fail out as the DB will be set implicitly and that will propegate automatically up to redis-py connection pool that will attempt to send SELECT command to redis when connection runs on_connect method and SELECT command is not supported when running a cluster node.

The proposed solution is to either strip out DB from the url before parsing it, or to hard fail when this is processed.