Skip to content

Commit b1b81d6

Browse files
committed
Replace Y_ABORT_UNLESS #2
1 parent 5f95b80 commit b1b81d6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ydb/core/persqueue/partition_read.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,8 @@ void TPartition::DoRead(TEvPQ::TEvRead::TPtr ev, TDuration waitQuotaTime, const
709709
const TString& user = read->ClientId;
710710
auto userInfo = UsersInfoStorage->GetIfExists(user);
711711
if(!userInfo) {
712-
ReplyError(ctx, read->Cookie, NPersQueue::NErrorCode::BAD_REQUEST, TStringBuilder() << "cannot finish read request. Consumer " << read->ClientId << " is gone from partition");
712+
ReplyError(ctx, read->Cookie, NPersQueue::NErrorCode::BAD_REQUEST,
713+
TStringBuilder() << "cannot finish read request. Consumer " << read->ClientId << " is gone from partition");
713714
Send(ReadQuotaTrackerActor, new TEvPQ::TEvConsumerRemoved(user));
714715
OnReadRequestFinished(read->Cookie, 0, user, ctx);
715716
return;
@@ -757,7 +758,11 @@ void TPartition::DoRead(TEvPQ::TEvRead::TPtr ev, TDuration waitQuotaTime, const
757758
return;
758759
}
759760

760-
Y_ABORT_UNLESS(offset < EndOffset);
761+
if (offset > EndOffset) {
762+
ReplyError(ctx, read->Cookie, NPersQueue::NErrorCode::BAD_REQUEST,
763+
TStringBuilder() << "Offset more than EndOffset. Offset=" << offset << ", EndOffset=" << EndOffset);
764+
return;
765+
}
761766

762767
ProcessRead(ctx, std::move(info), cookie, false);
763768
}

0 commit comments

Comments
 (0)