File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -242,9 +242,10 @@ void TReadSession::UpdateOffsets(const NTable::TTransaction& tx)
242
242
bool TReadSession::Close (TDuration timeout) {
243
243
LOG_LAZY (Log, TLOG_INFO, GetLogPrefix () << " Closing read session. Close timeout: " << timeout);
244
244
// Log final counters.
245
- CountersLogger->Stop ();
246
- {
247
- std::lock_guard guard (Lock);
245
+ if (CountersLogger) {
246
+ CountersLogger->Stop ();
247
+ }
248
+ with_lock (Lock) {
248
249
if (DumpCountersContext) {
249
250
DumpCountersContext->Cancel ();
250
251
}
@@ -257,8 +258,7 @@ bool TReadSession::Close(TDuration timeout) {
257
258
};
258
259
259
260
TDeferredActions<false > deferred;
260
- {
261
- std::lock_guard guard (Lock);
261
+ with_lock (Lock) {
262
262
if (Closing || Aborting) {
263
263
return false ;
264
264
}
@@ -348,7 +348,9 @@ void TReadSession::AbortImpl(TDeferredActions<false>&) {
348
348
if (DumpCountersContext) {
349
349
DumpCountersContext->Cancel ();
350
350
}
351
- CbContext->TryGet ()->Abort ();
351
+ if (CbContext) {
352
+ CbContext->TryGet ()->Abort ();
353
+ }
352
354
}
353
355
}
354
356
You can’t perform that action at this time.
0 commit comments