Skip to content

Commit

Permalink
Fix tsan flaky test MockSharedArbitrationTest.concurrentArbitrationWi…
Browse files Browse the repository at this point in the history
…thTransientRoots (facebookincubator#11365)

Summary:
Pull Request resolved: facebookincubator#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
  • Loading branch information
xiaoxmeng authored and facebook-github-bot committed Oct 28, 2024
1 parent 33b68aa commit 27d0527
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion velox/common/memory/MemoryPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ class MemoryPoolImpl : public MemoryPool {
std::unique_ptr<MemoryReclaimer> reclaimer_;

// The memory cap in bytes to enforce.
int64_t capacity_;
tsan_atomic<int64_t> capacity_;

// The number of reservation bytes.
tsan_atomic<int64_t> reservationBytes_{0};
Expand Down

0 comments on commit 27d0527

Please sign in to comment.