Skip to content

Commit 6d6492d

Browse files
committed
Fix Monitor's next_command parsing for CLUSTER SHARDS command - issue catched by a flaky test behavior
1 parent 0c90a7e commit 6d6492d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

redis/client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,9 +761,14 @@ def next_command(self):
761761
client_port = client_info[5:]
762762
client_type = "unix"
763763
else:
764-
# use rsplit as ipv6 addresses contain colons
765-
client_address, client_port = client_info.rsplit(":", 1)
766-
client_type = "tcp"
764+
if client_info == "":
765+
client_address = ""
766+
client_port = ""
767+
client_type = "unknown"
768+
else:
769+
# use rsplit as ipv6 addresses contain colons
770+
client_address, client_port = client_info.rsplit(":", 1)
771+
client_type = "tcp"
767772
return {
768773
"time": float(command_time),
769774
"db": int(db_id),

0 commit comments

Comments
 (0)