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,