Skip to content

Commit

Permalink
Fix Verify in WriteSessionActor (#2651)
Browse files Browse the repository at this point in the history
  • Loading branch information
nshestakov authored Mar 13, 2024
1 parent 7c77f08 commit c0a403c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions ydb/services/deprecated/persqueue_v0/grpc_pq_write_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ void TWriteSessionActor::SetupCounters(const TString& cloudId, const TString& db


void TWriteSessionActor::Handle(TEvDescribeTopicsResponse::TPtr& ev, const TActorContext& ctx) {
Y_ABORT_UNLESS(State == ES_WAIT_SCHEME || State == ES_INITED);
if (State != ES_WAIT_SCHEME && State != ES_INITED) {
return CloseSession("erroneous internal state", NPersQueue::NErrorCode::ERROR, ctx);
}

auto& res = ev->Get()->Result;
Y_ABORT_UNLESS(res->ResultSet.size() == 1);

Expand Down Expand Up @@ -865,7 +868,7 @@ void TWriteSessionActor::LogSession(const TActorContext& ctx) {

void TWriteSessionActor::HandleWakeup(const TActorContext& ctx) {
if (State != ES_INITED) {
return;
return CloseSession("erroneous internal state", NPersQueue::NErrorCode::ERROR, ctx);
}

auto now = ctx.Now();
Expand Down
5 changes: 4 additions & 1 deletion ydb/services/persqueue_v1/actors/write_session_actor.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,10 @@ void TWriteSessionActor<UseMigrationProtocol>::Handle(TEvents::TEvWakeup::TPtr&

template<bool UseMigrationProtocol>
void TWriteSessionActor<UseMigrationProtocol>::RecheckACL(const TActorContext& ctx) {
Y_ABORT_UNLESS(State == ES_INITED);
if (State != ES_INITED) {
LOG_ERROR_S(ctx, NKikimrServices::PQ_WRITE_PROXY, "WriteSessionActor state is wrong. Actual state '" << (int)State << "'");
return CloseSession("erroneous internal state", PersQueue::ErrorCode::ERROR, ctx);
}

auto now = ctx.Now();

Expand Down

0 comments on commit c0a403c

Please sign in to comment.