aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpechatnov <pechatnov@yandex-team.com>2025-02-04 19:53:16 +0300
committerpechatnov <pechatnov@yandex-team.com>2025-02-04 22:03:54 +0300
commitdc3b51309f2d396a9ec5039166a53da76fe220ea (patch)
tree846ba85bc5bd6604193e2cdee55b8d0255b0f828
parent8de4bd702eb90b0a0908781e3620c257484149bd (diff)
downloadydb-dc3b51309f2d396a9ec5039166a53da76fe220ea.tar.gz
[YT Flow] Fix race on vptr in TTransaction
Детали в комментариях к PR commit_hash:5f3bb29bdb2548ffbfd7cef0b7f59cac0c6e6e00
-rw-r--r--yt/yt/client/api/rpc_proxy/transaction.cpp7
-rw-r--r--yt/yt/client/api/rpc_proxy/transaction_impl.cpp3
-rw-r--r--yt/yt/client/api/rpc_proxy/transaction_impl.h2
3 files changed, 10 insertions, 2 deletions
diff --git a/yt/yt/client/api/rpc_proxy/transaction.cpp b/yt/yt/client/api/rpc_proxy/transaction.cpp
index 9e0c7423a1..454cbf6e6d 100644
--- a/yt/yt/client/api/rpc_proxy/transaction.cpp
+++ b/yt/yt/client/api/rpc_proxy/transaction.cpp
@@ -22,7 +22,7 @@ NApi::ITransactionPtr CreateTransaction(
i64 sequenceNumberSourceId,
TStringBuf capitalizedCreationReason)
{
- return New<TTransaction>(
+ auto transaction = New<TTransaction>(
std::move(connection),
std::move(client),
std::move(channel),
@@ -37,9 +37,12 @@ NApi::ITransactionPtr CreateTransaction(
std::move(stickyParameters),
sequenceNumberSourceId,
capitalizedCreationReason);
+
+ transaction->Initialize();
+
+ return transaction;
}
////////////////////////////////////////////////////////////////////////////////
} // namespace NYT::NApi::NRpcProxy
-
diff --git a/yt/yt/client/api/rpc_proxy/transaction_impl.cpp b/yt/yt/client/api/rpc_proxy/transaction_impl.cpp
index d4426488f4..cf732951ba 100644
--- a/yt/yt/client/api/rpc_proxy/transaction_impl.cpp
+++ b/yt/yt/client/api/rpc_proxy/transaction_impl.cpp
@@ -81,7 +81,10 @@ TTransaction::TTransaction(
PingPeriod_,
/*sticky*/ stickyParameters.has_value(),
StickyProxyAddress_);
+}
+void TTransaction::Initialize()
+{
// TODO(babenko): don't run periodic pings if client explicitly disables them in options
RunPeriodicPings();
}
diff --git a/yt/yt/client/api/rpc_proxy/transaction_impl.h b/yt/yt/client/api/rpc_proxy/transaction_impl.h
index e191a6fb79..300f3a9bd9 100644
--- a/yt/yt/client/api/rpc_proxy/transaction_impl.h
+++ b/yt/yt/client/api/rpc_proxy/transaction_impl.h
@@ -48,6 +48,8 @@ public:
i64 sequenceNumberSourceId,
TStringBuf capitalizedCreationReason);
+ void Initialize();
+
// ITransaction implementation.
NApi::IConnectionPtr GetConnection() override;
NApi::IClientPtr GetClient() const override;