File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -107,23 +107,22 @@ void TWriteSessionImpl::Start(const TDuration& delay) {
107
107
EventsQueue = std::make_shared<TWriteSessionEventsQueue>(Settings);
108
108
}
109
109
110
- ++ConnectionAttemptsDone;
111
110
if (!Started) {
112
- {
113
- std::lock_guard guard (Lock);
111
+ with_lock (Lock) {
114
112
HandleWakeUpImpl ();
115
113
}
116
114
InitWriter ();
117
115
}
118
- Started = true ;
119
-
120
- if (Settings. DirectWriteToPartition_ && (Settings. PartitionId_ . has_value () || DirectWriteToPartitionId. has_value ())) {
121
- std::lock_guard guard (Lock);
122
- PreferredPartitionLocation = {};
123
- return ConnectToPreferredPartitionLocation (delay);
124
- } else {
125
- return Connect (delay);
116
+ with_lock (Lock) {
117
+ ++ConnectionAttemptsDone;
118
+ Started = true ;
119
+ if (Settings. DirectWriteToPartition_ && (Settings. PartitionId_ . has_value () || DirectWriteToPartitionId. has_value ())) {
120
+ PreferredPartitionLocation = {};
121
+ ConnectToPreferredPartitionLocation (delay);
122
+ return ;
123
+ }
126
124
}
125
+ Connect (delay);
127
126
}
128
127
129
128
// Returns true if we need to switch to another DirectWriteToPartitionId.
@@ -243,6 +242,8 @@ void TWriteSessionImpl::ConnectToPreferredPartitionLocation(const TDuration& del
243
242
return ;
244
243
}
245
244
245
+ ++ConnectionGeneration;
246
+
246
247
prevDescribePartitionContext = std::exchange (DescribePartitionContext, describePartitionContext);
247
248
Y_ASSERT (DescribePartitionContext);
248
249
Cancel (prevDescribePartitionContext);
You can’t perform that action at this time.
0 commit comments