kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [kudu] 01/02: char_util-test: disable TSAN instrumentation in stress tests
Date Thu, 05 Dec 2019 00:16:12 GMT
This is an automated email from the ASF dual-hosted git repository.

adar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit ac6198f5055e62979f79660a81443844262c7d2e
Author: Adar Dembo <adar@cloudera.com>
AuthorDate: Wed Dec 4 12:36:58 2019 -0800

    char_util-test: disable TSAN instrumentation in stress tests
    
    The UTF8 stress test was sometimes timing out in TSAN precommit.
    
    Change-Id: Ibaafba2e73cdfeec3ca3f7091cedc316238600b2
    Reviewed-on: http://gerrit.cloudera.org:8080/14835
    Reviewed-by: Andrew Wong <awong@cloudera.com>
    Tested-by: Adar Dembo <adar@cloudera.com>
---
 src/kudu/util/char_util-test.cc | 5 +++++
 src/kudu/util/char_util.cc      | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/kudu/util/char_util-test.cc b/src/kudu/util/char_util-test.cc
index eb41355..b65e203 100644
--- a/src/kudu/util/char_util-test.cc
+++ b/src/kudu/util/char_util-test.cc
@@ -23,6 +23,7 @@
 #include <glog/logging.h>
 #include <gtest/gtest.h>
 
+#include "kudu/util/debug/sanitizer_scopes.h"
 #include "kudu/util/env.h"
 #include "kudu/util/faststring.h"
 #include "kudu/util/init.h"
@@ -60,6 +61,10 @@ class CharUtilTest : public KuduTest {
   }
 
   void StressTest(const Slice& slice, int length) {
+    // The memory accesses done in UTF8Truncate are quite slow with TSAN
+    // instrumentation, probably because so many of them are unaligned.
+    // Since this test is single-threaded, let's just disable TSAN in it.
+    debug::ScopedTSANIgnoreReadsAndWrites ignore_tsan;
     for (int i = 0; i < kNumCycles_; ++i) {
       Slice result;
       auto ptr = Truncate(slice, length, &result);
diff --git a/src/kudu/util/char_util.cc b/src/kudu/util/char_util.cc
index 4d798e1..e864d87 100644
--- a/src/kudu/util/char_util.cc
+++ b/src/kudu/util/char_util.cc
@@ -17,11 +17,12 @@
 
 #include "kudu/util/char_util.h"
 
-#include <algorithm>
-#include <cstring>
 #include <emmintrin.h>
 #include <smmintrin.h>
 
+#include <algorithm>
+#include <cstring>
+
 namespace kudu {
 
 Slice UTF8Truncate(Slice val, size_t max_utf8_length) {


Mime
View raw message