Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure command details are populated for Cluster clients
Previously, if a clustered client is unable to query any of the nodes for command details during setup, it'd initialize successfully, but without any command details. (This is a bit of a corner case - in order to hit this case, at least one node needs to be reachable when querying nodes + slots, but all nodes would need to be unreachable immediately afterwards when querying command details.) In this case, the client would be unable to determine which node a given command should be routed to. Because the client falls back to routing commands to a random node, and following redirects as necessary, this wouldn't cause any overt problems, but leaves the client following unnecessary redirects for the rest of the lifespan of the client. This patch changes the client to require that the initial fetch of command details succeeds (as is already done with slot and node detail fetching), and raises a CannotConnectError if that's not possible. Users should already handle this error, and retry creating the client later, or use some other suitable failure handling mechanism.
- Loading branch information