Skip to content

Commit

Permalink
fix: Silence falsy Redis timeout warnings with blocking commands (#2632)
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol authored Aug 3, 2024
1 parent 970535a commit 2b41d6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/2632.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Silence falsy Redis timeout warnings when retrying blocking commands if the timeout does not exceed the expected command timeout
1 change: 1 addition & 0 deletions src/ai/backend/common/redis_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit 2b41d6d

Please sign in to comment.