diff --git a/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc b/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc index 01bdb303ed94..4e9e3bbe8964 100644 --- a/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc +++ b/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc @@ -982,8 +982,8 @@ SplitRequestPtr PubSubRequest::create(Router& router, Common::Redis::RespValuePt transaction.should_close_ = true; return nullptr; } - // This flow is used when we have one private client (subscribe test) but now we are issuing unsub/punsun which will require three clients and hence we need to resize. - if (transaction.isSubscribedMode() && (command_name == "unsubscribe" || command_name == "punsubscribe")) { + // This flow is used when we have one private client (subscribe test) but now we are issuing unsub/punsun/subscribe keyspace or keyevent which will require three clients and hence we need to resize. + if (transaction.isSubscribedMode()) { if (transaction.clients_.size() != static_cast(requestsCount)) { transaction.clients_.resize(requestsCount); }