Skip to content

Commit fc6864d

Browse files
authored
ydb_topic: Call non-dataEvent callbacks immediately (#10751)
1 parent ee522b6 commit fc6864d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ydb/public/sdk/cpp/client/ydb_topic/impl/read_session_impl.ipp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1955,7 +1955,7 @@ void TSingleClusterReadSessionImpl<UseMigrationProtocol>::TrySubscribeOnTransact
19551955

19561956
auto callback = [cbContext = this->SelfContext, txId, txInfo, consumer = Settings.ConsumerName_, client]() {
19571957
TVector<TTopicOffsets> offsets;
1958-
1958+
19591959
with_lock (txInfo->Lock) {
19601960
Y_ABORT_UNLESS(!txInfo->CommitCalled);
19611961

@@ -2090,6 +2090,13 @@ bool TReadSessionEventsQueue<UseMigrationProtocol>::PushEvent(TIntrusivePtr<TPar
20902090
stream->DeleteNotReadyTail(deferred);
20912091
}
20922092

2093+
if (!HasDataEventCallback() && !std::holds_alternative<TADataReceivedEvent<UseMigrationProtocol>>(event)) {
2094+
// Call non-dataEvent callbacks immediately.
2095+
if (TryApplyCallbackToEventImpl(event, deferred, CbContext)) {
2096+
return true;
2097+
}
2098+
}
2099+
20932100
stream->InsertEvent(std::move(event));
20942101
Y_ASSERT(stream->HasEvents());
20952102

0 commit comments

Comments
 (0)