This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new d1bc5b53e Fix deadlock on fail for CBTree-test
d1bc5b53e is described below
commit d1bc5b53ef006ac14bca4417c4745c5875d89734
Author: Zoltan Martonka <[email protected]>
AuthorDate: Wed May 22 13:48:06 2024 +0000
Fix deadlock on fail for CBTree-test
When TestConcurrentIterateAndInsert, TestConcurrentInsert,
TestRacyConcurrentInsert fail while --gtest_repeat is used, they
will keep running forever. Instead of just returning on fail,
they should properly stop the other threads running, and then exit.
To reproduce the problem, run this on ARM (where the test actually
fails):
./bin/cbtree-test --gtest_repeat=100 --gtest_filter=*Racy*
Change-Id: Ia10d05dfdc4a12cb034450f432693f054d138498
Reviewed-on: http://gerrit.cloudera.org:8080/21446
Tested-by: Alexey Serbin <[email protected]>
Reviewed-by: Alexey Serbin <[email protected]>
---
src/kudu/tablet/cbtree-test.cc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/kudu/tablet/cbtree-test.cc b/src/kudu/tablet/cbtree-test.cc
index 7a8c3a420..32cd7b75c 100644
--- a/src/kudu/tablet/cbtree-test.cc
+++ b/src/kudu/tablet/cbtree-test.cc
@@ -28,6 +28,7 @@
#include <glog/logging.h>
#include <gtest/gtest.h>
+#include "kudu/gutil/atomicops.h"
#include "kudu/gutil/stringprintf.h"
#include "kudu/gutil/strings/substitute.h"
#include "kudu/tablet/concurrent_btree.h"
@@ -474,14 +475,14 @@ void TestCBTree::DoTestConcurrentInsert() {
if (::testing::Test::HasFatalFailure()) {
tree->DebugPrint();
- return;
+ break;
}
}
tree.reset(nullptr);
go_barrier.Wait();
- for (thread &thr : threads) {
+ for (thread& thr : threads) {
thr.join();
}
}
@@ -739,7 +740,7 @@ TEST_F(TestCBTree, TestConcurrentIterateAndInsert) {
if (::testing::Test::HasFatalFailure()) {
tree->DebugPrint();
- return;
+ break;
}
}