Open ofhellsfire opened 4 years ago
@Grokzen Just in case I'm sharing how we fixed/patched this issue for ourselves temporarily:
def scan_iter(self, match=None, count=None, _type=None):
success_flg = False
retry_count = -1
while (not success_flg and retry_count < self.cluster_down_retry_attempts):
try:
yield from self._scan_iter(match, count, _type)
success_flg = True
except ConnectionError:
self.connection_pool.disconnect()
self.connection_pool.nodes.reset()
retry_count += 1
if retry_count < self.cluster_down_retry_attempts:
time.sleep(self.cluster_down_retry_timeout)
else:
raise
...
# original scan_iter()
def _scan_iter(self, match=None, count=None, _type=None):
...
I know this is not optimal (you've written about it somewhere), but we just needed a quick fix since we cannot afford the redis client failure from one side, from the other side handling failure in the app code would be not optimal for the long run.
Issue Description: Bunch of exceptions occured (
redis.exceptions.ConnectionError
is one of those) whenscan_iter()
method is called during failover.Scenario
Env
Steps to reproduce
scan_iter()
method.Expected result Script proceeds without exceptions.
Actual Result Script gets stuck and there are a bunch of exceptions are raised.
Output