aboutsummaryrefslogtreecommitdiffstats
path: root/yt/cpp
diff options
context:
space:
mode:
authorermolovd <ermolovd@yandex-team.com>2023-08-24 18:16:36 +0300
committerermolovd <ermolovd@yandex-team.com>2023-08-24 18:32:42 +0300
commit3d40978be0626fb1242c81ca9242c45464375574 (patch)
tree295c23526fd3470f4abe4297f5a3e9b7bc6d9755 /yt/cpp
parentde6e39881d059d67cbcc978d076d9e3e5e9732fc (diff)
downloadydb-3d40978be0626fb1242c81ca9242c45464375574.tar.gz
Fix race in client
Diffstat (limited to 'yt/cpp')
-rw-r--r--yt/cpp/mapreduce/client/client.cpp5
-rw-r--r--yt/cpp/mapreduce/client/client.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/yt/cpp/mapreduce/client/client.cpp b/yt/cpp/mapreduce/client/client.cpp
index ca979c5588..a395174f79 100644
--- a/yt/cpp/mapreduce/client/client.cpp
+++ b/yt/cpp/mapreduce/client/client.cpp
@@ -1224,7 +1224,7 @@ void TClient::ResumeOperation(
TYtPoller& TClient::GetYtPoller()
{
- auto g = Guard(YtPollerLock_);
+ auto g = Guard(Lock_);
if (!YtPoller_) {
CheckShutdown();
// We don't use current client and create new client because YtPoller_ might use
@@ -1237,7 +1237,7 @@ TYtPoller& TClient::GetYtPoller()
void TClient::Shutdown()
{
- auto g = Guard(YtPollerLock_);
+ auto g = Guard(Lock_);
if (!Shutdown_.exchange(true) && YtPoller_) {
YtPoller_->Stop();
@@ -1246,6 +1246,7 @@ void TClient::Shutdown()
ITransactionPingerPtr TClient::GetTransactionPinger()
{
+ auto g = Guard(Lock_);
if (!TransactionPinger_) {
TransactionPinger_ = CreateTransactionPinger(Context_.Config);
}
diff --git a/yt/cpp/mapreduce/client/client.h b/yt/cpp/mapreduce/client/client.h
index 0f4df09d0b..453b79f2a7 100644
--- a/yt/cpp/mapreduce/client/client.h
+++ b/yt/cpp/mapreduce/client/client.h
@@ -490,7 +490,7 @@ private:
ITransactionPingerPtr TransactionPinger_;
std::atomic<bool> Shutdown_ = false;
- TMutex YtPollerLock_;
+ TMutex Lock_;
THolder<TYtPoller> YtPoller_;
};