From 27d05274fcc5f53d1c8796da02e58b044f5ca375 Mon Sep 17 00:00:00 2001 From: Xiaoxuan Meng Date: Mon, 28 Oct 2024 14:12:50 -0700 Subject: [PATCH] Fix tsan flaky test MockSharedArbitrationTest.concurrentArbitrationWithTransientRoots (#11365) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/11365 concurrentArbitrationWithTransientRoots detects a data race when we try to log root pool's capacity from a leaf pool which doesn't hold the lock on the root but only the leaf. This is mostly for logging and we don't want to introduce the locking on the root which might cause potential deadlock or performance issue. Change this to tsan variable to pass the test. Reviewed By: tanjialiang Differential Revision: D65075928 fbshipit-source-id: 88ad38cdcb1a4f991c224e99080020d4448eb32f --- velox/common/memory/MemoryPool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/velox/common/memory/MemoryPool.h b/velox/common/memory/MemoryPool.h index 0feb54fda04a..506c592bcc4f 100644 --- a/velox/common/memory/MemoryPool.h +++ b/velox/common/memory/MemoryPool.h @@ -1030,7 +1030,7 @@ class MemoryPoolImpl : public MemoryPool { std::unique_ptr reclaimer_; // The memory cap in bytes to enforce. - int64_t capacity_; + tsan_atomic capacity_; // The number of reservation bytes. tsan_atomic reservationBytes_{0};