From: Yuval Lifshitz Date: Mon, 22 Jul 2024 16:10:55 +0000 (+0000) Subject: test/cls_2pc_queue: fix multi-threaded access to non-atomic variables X-Git-Tag: testing/wip-khiremat-testing-20250424.121018-squid-debug~27^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=66f38baf3bce5272f7add32340381e2fa3ab50c8;p=ceph-ci.git test/cls_2pc_queue: fix multi-threaded access to non-atomic variables Fixes: https://tracker.ceph.com/issues/63786 Signed-off-by: Yuval Lifshitz (cherry picked from commit 6f9f52033b0bb7b03ef569f12a970793ca65f0e8) Fixes: https://tracker.ceph.com/issues/67143 Signed-off-by: Adam C. Emerson --- diff --git a/src/test/cls_2pc_queue/test_cls_2pc_queue.cc b/src/test/cls_2pc_queue/test_cls_2pc_queue.cc index 83849792490..f0c71c7492e 100644 --- a/src/test/cls_2pc_queue/test_cls_2pc_queue.cc +++ b/src/test/cls_2pc_queue/test_cls_2pc_queue.cc @@ -803,7 +803,7 @@ TEST_F(TestCls2PCQueue, MultiProducer) cls_2pc_queue_init(op, queue_name, max_size); ASSERT_EQ(0, ioctx.operate(queue_name, &op)); - auto producer_count = max_producer_count; + std::atomic producer_count = max_producer_count; std::vector producers(max_producer_count); for (auto& p : producers) { @@ -925,9 +925,9 @@ TEST_F(TestCls2PCQueue, MultiProducerConsumer) cls_2pc_queue_init(op, queue_name, max_size); ASSERT_EQ(0, ioctx.operate(queue_name, &op)); - auto producer_count = max_workers; + std::atomic producer_count = max_workers; - auto retry_happened = false; + std::atomic retry_happened = false; std::vector producers(max_workers); for (auto& p : producers) {