Skip to content

Commit 4077a5a

Browse files
author
cherepashka
committed
YT-26173: Fix data race on vptr in async exp cache
commit_hash:7d65c7dd7ef5f023fb8cd6ae293198b3da99b5fa
1 parent 872a22d commit 4077a5a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

yt/yt/core/misc/async_expiring_cache-inl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ TAsyncExpiringCache<TKey, TValue>::TAsyncExpiringCache(
5050
{
5151
RefreshExecutor_->SetPeriod(config->RefreshTime);
5252
ExpirationExecutor_->SetPeriod(config->ExpirationPeriod);
53+
}
54+
55+
template <class TKey, class TValue>
56+
void TAsyncExpiringCache<TKey, TValue>::Initialize()
57+
{
58+
auto config = GetConfig();
5359
if (config->BatchUpdate) {
5460
if (config->RefreshTime && *config->RefreshTime) {
5561
RefreshExecutor_->Start();

yt/yt/core/misc/async_expiring_cache.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class TAsyncExpiringCache
4545
// TODO(cherepashka): remove default value and move upper.
4646
const IInvokerPtr& invoker = NYT::NRpc::TDispatcher::Get()->GetHeavyInvoker());
4747

48+
void Initialize();
49+
4850
TFuture<TValue> Get(const TKey& key);
4951
TExtendedGetResult GetExtended(const TKey& key);
5052
TFuture<std::vector<TErrorOr<TValue>>> GetMany(const std::vector<TKey>& keys);

0 commit comments

Comments
 (0)