From 2b41d6dd21600a27a5400b099bfb1568e599f20c Mon Sep 17 00:00:00 2001 From: Joongi Kim Date: Sat, 3 Aug 2024 22:17:05 +0900 Subject: [PATCH] fix: Silence falsy Redis timeout warnings with blocking commands (#2632) --- changes/2632.fix.md | 1 + src/ai/backend/common/redis_helper.py | 1 + 2 files changed, 2 insertions(+) create mode 100644 changes/2632.fix.md diff --git a/changes/2632.fix.md b/changes/2632.fix.md new file mode 100644 index 0000000000..3638521c3e --- /dev/null +++ b/changes/2632.fix.md @@ -0,0 +1 @@ +Silence falsy Redis timeout warnings when retrying blocking commands if the timeout does not exceed the expected command timeout diff --git a/src/ai/backend/common/redis_helper.py b/src/ai/backend/common/redis_helper.py index c43ab8bbdb..69f136735d 100644 --- a/src/ai/backend/common/redis_helper.py +++ b/src/ai/backend/common/redis_helper.py @@ -267,6 +267,7 @@ def show_retry_warning(e: Exception, warn_on_first_attempt: bool = True) -> None now = time.perf_counter() if now - first_trial >= command_timeout + 1.0: show_retry_warning(e) + first_trial = now continue except redis.exceptions.ResponseError as e: if "NOREPLICAS" in e.args[0]: