Skip to content

Commit ed6691b

Browse files
kardymondsGazizonoki
authored andcommitted
Moved "YQ-3192 Fix validate settings fail on start" commit from ydb repo
1 parent bdd6b9d commit ed6691b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/client/topic/impl/read_session.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,10 @@ void TReadSession::UpdateOffsets(const NTable::TTransaction& tx)
242242
bool TReadSession::Close(TDuration timeout) {
243243
LOG_LAZY(Log, TLOG_INFO, GetLogPrefix() << "Closing read session. Close timeout: " << timeout);
244244
// Log final counters.
245-
CountersLogger->Stop();
246-
{
247-
std::lock_guard guard(Lock);
245+
if (CountersLogger) {
246+
CountersLogger->Stop();
247+
}
248+
with_lock(Lock) {
248249
if (DumpCountersContext) {
249250
DumpCountersContext->Cancel();
250251
}
@@ -257,8 +258,7 @@ bool TReadSession::Close(TDuration timeout) {
257258
};
258259

259260
TDeferredActions<false> deferred;
260-
{
261-
std::lock_guard guard(Lock);
261+
with_lock(Lock) {
262262
if (Closing || Aborting) {
263263
return false;
264264
}
@@ -348,7 +348,9 @@ void TReadSession::AbortImpl(TDeferredActions<false>&) {
348348
if (DumpCountersContext) {
349349
DumpCountersContext->Cancel();
350350
}
351-
CbContext->TryGet()->Abort();
351+
if (CbContext) {
352+
CbContext->TryGet()->Abort();
353+
}
352354
}
353355
}
354356

0 commit comments

Comments
 (0)