Browse Source

Use fallthrough and fix holder initialization (#1221)

Nikolay Shestakov 1 year ago
parent
commit
8797869d3a
2 changed files with 7 additions and 1 deletions
  1. 6 0
      ydb/core/kafka_proxy/kafka_connection.cpp
  2. 1 1
      ydb/core/persqueue/pq_impl.cpp

+ 6 - 0
ydb/core/kafka_proxy/kafka_connection.cpp

@@ -606,6 +606,8 @@ protected:
 
                         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 @@ protected:
                         InflightSize += Request->ExpectedSize;
                         Step = MESSAGE_READ;
 
+                        [[fallthrough]];
+
                     case HEADER_READ:
                         KAFKA_LOG_T("start read header. ExpectedSize=" << Request->ExpectedSize);
 
@@ -649,6 +653,8 @@ protected:
 
                         Step = MESSAGE_READ;
 
+                        [[fallthrough]];
+
                     case MESSAGE_READ:
                         KAFKA_LOG_T("start read new message. ExpectedSize=" << Request->ExpectedSize);
 

+ 1 - 1
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<TEvPQ::TEvSourceIdResponse>();
+        auto response = MakeHolder<TEvPQ::TEvSourceIdResponse>();
         response->Record.SetError("Partition was not found");
         Send(ev->Sender, response.Release());