From b893d2df822bec2473b87fd8e77ce99f5c5f76e9 Mon Sep 17 00:00:00 2001 From: QuantumGhost Date: Fri, 6 Feb 2026 14:42:04 +0800 Subject: [PATCH] docs(api): add a short note about the `target_node` argument --- api/libs/broadcast_channel/redis/sharded_channel.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/libs/broadcast_channel/redis/sharded_channel.py b/api/libs/broadcast_channel/redis/sharded_channel.py index 6dfb494ad7..8d4d7873ca 100644 --- a/api/libs/broadcast_channel/redis/sharded_channel.py +++ b/api/libs/broadcast_channel/redis/sharded_channel.py @@ -70,6 +70,10 @@ class _RedisShardedSubscription(RedisSubscriptionBase): # Since we have already filtered at the caller's site, we can safely set # `ignore_subscribe_messages=False`. if isinstance(self._client, RedisCluster): + # NOTE(QuantumGhost): due to an issue in upstream code, calling `get_sharded_message` + # would use busy-looping to wait for incoming message, consuming excessive CPU quota. + # + # Here we specify the `target_node` to mitigate this problem. node = self._client.get_node_from_key(self._topic) return self._pubsub.get_sharded_message( ignore_subscribe_messages=False,