You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Retry behaviour in Redis Cluster is a little bit different from Standalone:
50
+
51
+
* ``retry``: :class:`~.Retry` instance with a :ref:`backoff-label` strategy and the max number of retries, default value is ``Retry(NoBackoff(), 0)``
52
+
* ``cluster_error_retry_attempts``: number of times to retry before raising an error when :class:`~.TimeoutError` or :class:`~.ConnectionError` or :class:`~.ClusterDownError` are encountered, default value is ``3``
#. the client library calculates the hash slot for key 'foo'.
64
+
#. given the hash slot, it then determines which node to connect to, in order to execute the command.
65
+
#. during the connection, a :class:`~.ConnectionError` is raised.
66
+
#. because we set ``retry=Retry(ExponentialBackoff(), 6)``, the client tries to reconnect to the node up to 6 times, with an exponential backoff between each attempt.
67
+
#. even after 6 retries, the client is still unable to connect.
68
+
#. because we set ``cluster_error_retry_attempts=1``, before giving up, the client starts a cluster update, removes the failed node from the startup nodes, and re-initializes the cluster.
69
+
#. after the cluster has been re-initialized, it starts a new cycle of retries, up to 6 retries, with an exponential backoff.
70
+
#. if the client can connect, we're good. Otherwise, the exception is finally raised to the caller, because we've run out of attempts.
0 commit comments