File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -546,29 +546,29 @@ void TWriteSessionImpl::Connect(const TDuration& delay) {
546
546
std::function<void (TPlainStatus&&, typename IProcessor::TPtr&&)> connectCallback;
547
547
std::function<void (bool )> connectTimeoutCallback;
548
548
549
- {
550
- std::lock_guard guard (Lock);
549
+ with_lock (Lock) {
551
550
if (Aborting) {
552
551
return ;
553
552
}
554
553
555
554
LOG_LAZY (DbDriverState->Log , TLOG_INFO, LogPrefix () << " Start write session. Will connect to nodeId: " << PreferredPartitionLocation.Endpoint .NodeId );
556
555
557
556
++ConnectionGeneration;
558
- auto subclient = Client;
559
- connectionFactory = subclient->CreateWriteSessionConnectionProcessorFactory ();
560
- auto clientContext = subclient->CreateContext ();
561
- ConnectionFactory = connectionFactory;
562
-
563
- ClientContext = std::move (clientContext);
564
- ServerMessage = std::make_shared<TServerMessage>();
565
557
566
558
if (!ClientContext) {
567
- AbortImpl ();
568
- // Grpc and WriteSession is closing right now.
569
- return ;
559
+ ClientContext = Client->CreateContext ();
560
+ if (!ClientContext) {
561
+ AbortImpl ();
562
+ // Grpc and WriteSession is closing right now.
563
+ return ;
564
+ }
570
565
}
571
566
567
+ ServerMessage = std::make_shared<TServerMessage>();
568
+
569
+ connectionFactory = Client->CreateWriteSessionConnectionProcessorFactory ();
570
+ ConnectionFactory = connectionFactory;
571
+
572
572
connectContext = ClientContext->CreateContext ();
573
573
if (delay)
574
574
connectDelayContext = ClientContext->CreateContext ();
You can’t perform that action at this time.
0 commit comments