diff options
author | Vasily Gerasimov <UgnineSirdis@ydb.tech> | 2024-11-26 08:47:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-26 08:47:54 +0200 |
commit | e0b1bef38c58fdfcfd92760e6a3926848be64905 (patch) | |
tree | 2800c8ed83d64c1e31c5e21c0bb6ad7d69e03c9a | |
parent | e3da276a83713b1567d299399e0d77e310e09d1f (diff) | |
download | ydb-e0b1bef38c58fdfcfd92760e6a3926848be64905.tar.gz |
Fix memory order for tracing control (#11949)
-rw-r--r-- | ydb/core/jaeger_tracing/sampling_throttling_control.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ydb/core/jaeger_tracing/sampling_throttling_control.cpp b/ydb/core/jaeger_tracing/sampling_throttling_control.cpp index 584eeb54d4..4260349521 100644 --- a/ydb/core/jaeger_tracing/sampling_throttling_control.cpp +++ b/ydb/core/jaeger_tracing/sampling_throttling_control.cpp @@ -13,8 +13,8 @@ TSamplingThrottlingControl::~TSamplingThrottlingControl() { } void TSamplingThrottlingControl::HandleTracing(NWilson::TTraceId& traceId, const TRequestDiscriminator& discriminator) { - if (ImplUpdate.load(std::memory_order_relaxed)) { - auto newImpl = std::unique_ptr<TSamplingThrottlingImpl>(ImplUpdate.exchange(nullptr, std::memory_order_relaxed)); + if (ImplUpdate.load(std::memory_order_acquire)) { + auto newImpl = std::unique_ptr<TSamplingThrottlingImpl>(ImplUpdate.exchange(nullptr, std::memory_order_acquire)); Y_ABORT_UNLESS(newImpl); Impl = std::move(newImpl); } @@ -22,7 +22,7 @@ void TSamplingThrottlingControl::HandleTracing(NWilson::TTraceId& traceId, const } void TSamplingThrottlingControl::UpdateImpl(std::unique_ptr<TSamplingThrottlingImpl> newImpl) { - std::unique_ptr<TSamplingThrottlingImpl> guard(ImplUpdate.exchange(newImpl.release(), std::memory_order_relaxed)); + std::unique_ptr<TSamplingThrottlingImpl> guard(ImplUpdate.exchange(newImpl.release(), std::memory_order_acq_rel)); } } // namespace NKikimr::NJaegerTracing |