fix(redis): use await asyncio.sleep() instead of time.sleep() in async generator (#25823)
time.sleep() inside the _wrap_async_gen() async generator blocks the entire event loop during Sentinel failover retries. The sibling method _wrap_async_call() already correctly uses await asyncio.sleep().
This commit is contained in:
@@ -185,7 +185,7 @@ class SentinelRedisProxy:
|
||||
if proxy._should_retry(attempt):
|
||||
proxy._log_retry(exc, attempt)
|
||||
if REDIS_RECONNECT_DELAY:
|
||||
time.sleep(REDIS_RECONNECT_DELAY / 1000)
|
||||
await asyncio.sleep(REDIS_RECONNECT_DELAY / 1000)
|
||||
continue
|
||||
proxy._log_exhausted(exc)
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user