From 8ac0c42f3c9d83c7e3b40e4e73a07c2eed6912f7 Mon Sep 17 00:00:00 2001 From: Nikolay Shestakov Date: Tue, 23 Jan 2024 09:35:30 +0000 Subject: [PATCH] Use fallthrough and fix holder initialization --- ydb/core/kafka_proxy/kafka_connection.cpp | 6 ++++++ ydb/core/persqueue/pq_impl.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ydb/core/kafka_proxy/kafka_connection.cpp b/ydb/core/kafka_proxy/kafka_connection.cpp index de4ca12a8d85..cca305787023 100644 --- a/ydb/core/kafka_proxy/kafka_connection.cpp +++ b/ydb/core/kafka_proxy/kafka_connection.cpp @@ -606,6 +606,8 @@ class TKafkaConnection: public TActorBootstrapped, public TNet Step = INFLIGTH_CHECK; + [[fallthrough]]; + case INFLIGTH_CHECK: if (!Context->Authenticated() && !PendingRequestsQueue.empty()) { // Allow only one message to be processed at a time for non-authenticated users @@ -618,6 +620,8 @@ class TKafkaConnection: public TActorBootstrapped, public TNet InflightSize += Request->ExpectedSize; Step = MESSAGE_READ; + [[fallthrough]]; + case HEADER_READ: KAFKA_LOG_T("start read header. ExpectedSize=" << Request->ExpectedSize); @@ -649,6 +653,8 @@ class TKafkaConnection: public TActorBootstrapped, public TNet Step = MESSAGE_READ; + [[fallthrough]]; + case MESSAGE_READ: KAFKA_LOG_T("start read new message. ExpectedSize=" << Request->ExpectedSize); diff --git a/ydb/core/persqueue/pq_impl.cpp b/ydb/core/persqueue/pq_impl.cpp index 7a249bb3fdab..a26eef66028a 100644 --- a/ydb/core/persqueue/pq_impl.cpp +++ b/ydb/core/persqueue/pq_impl.cpp @@ -3890,7 +3890,7 @@ void TPersQueue::Handle(TEvPQ::TEvSourceIdRequest::TPtr& ev, const TActorContext if (it == Partitions.end()) { LOG_INFO_S(ctx, NKikimrServices::PERSQUEUE, "Unknown partition " << record.GetPartition()); - auto response = THolder(); + auto response = MakeHolder(); response->Record.SetError("Partition was not found"); Send(ev->Sender, response.Release());