Skip to content

Commit

Permalink
Merge 128ea85 into f1fd705
Browse files Browse the repository at this point in the history
  • Loading branch information
qyryq authored Jun 4, 2024
2 parents f1fd705 + 128ea85 commit 89967b2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ydb/public/sdk/cpp/client/ydb_topic/impl/write_session_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,22 @@ void TWriteSessionImpl::Start(const TDuration& delay) {
EventsQueue = std::make_shared<TWriteSessionEventsQueue>(Settings);
}

++ConnectionAttemptsDone;
if (!Started) {
with_lock(Lock) {
HandleWakeUpImpl();
}
InitWriter();
}
Started = true;
if (Settings.DirectWriteToPartition_ && (Settings.PartitionId_.Defined() || DirectWriteToPartitionId.Defined())) {
with_lock (Lock) {
with_lock (Lock) {
++ConnectionAttemptsDone;
Started = true;
if (Settings.DirectWriteToPartition_ && (Settings.PartitionId_.Defined() || DirectWriteToPartitionId.Defined())) {
PreferredPartitionLocation = {};
return ConnectToPreferredPartitionLocation(delay);
ConnectToPreferredPartitionLocation(delay);
return;
}
}
else
{
return Connect(delay);
}
Connect(delay);
}

// Returns true if we need to switch to another DirectWriteToPartitionId.
Expand Down Expand Up @@ -234,6 +232,8 @@ void TWriteSessionImpl::ConnectToPreferredPartitionLocation(const TDuration& del
return;
}

++ConnectionGeneration;

prevDescribePartitionContext = std::exchange(DescribePartitionContext, describePartitionContext);
Y_ASSERT(DescribePartitionContext);
Cancel(prevDescribePartitionContext);
Expand Down

0 comments on commit 89967b2

Please sign in to comment.