You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2020/12/12 03:08:33 UTC

[kudu] 02/03: [master-test] fix race in ConcurrentGetTableSchemaTest

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

commit c1d1b9ccebe73bd60d3f6c8c8d8f9c3c426bdb6b
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Fri Dec 11 18:07:17 2020 -0800

    [master-test] fix race in ConcurrentGetTableSchemaTest
    
    This patch adds explicit joining for the worker threads before
    trying to accumulate per-thread counters.  Prior to this patch,
    a rare race was reported in TSAN builds.
    
    Change-Id: I5bc620c61320587fea92706c94b113a3bbd3e91e
    Reviewed-on: http://gerrit.cloudera.org:8080/16865
    Reviewed-by: Andrew Wong <aw...@cloudera.com>
    Tested-by: Kudu Jenkins
---
 src/kudu/master/master-test.cc | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/kudu/master/master-test.cc b/src/kudu/master/master-test.cc
index 0caf538..a897b00 100644
--- a/src/kudu/master/master-test.cc
+++ b/src/kudu/master/master-test.cc
@@ -1357,14 +1357,12 @@ TEST_P(ConcurrentGetTableSchemaTest, DirectMethodCall) {
       }
     });
   }
-  SCOPED_CLEANUP({
-    for (auto& t : caller_threads) {
-      t.join();
-    }
-  });
 
   SleepFor(kRunInterval);
   done.Store(true);
+  for (auto& t : caller_threads) {
+    t.join();
+  }
 
   const auto errors = accumulate(error_counters.begin(), error_counters.end(), 0UL);
   if (errors != 0) {