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:
G30
2026-06-29 02:25:46 -05:00
committed by GitHub
parent 2308b59f13
commit 71d6212ab8
+1 -1
View File
@@ -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