kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject kudu git commit: Add a workaround for LSAN bug #757
Date Mon, 05 Jun 2017 21:06:31 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 732ee211a -> 0f31386d2


Add a workaround for LSAN bug #757

This adds a workaround for an LSAN bug[1] which causes some tests to
report false positive leaks when shutting down minicluster daemons.
The workaround simply retries the checks a few times to see if they go
away.

Hopefully this will reduce flakiness of exactly_once_writes-itest.

https://github.com/google/sanitizers/issues/757

Change-Id: Id79e4ed7fa6311bcabdb55b8d4fff9f9a4f242bc
Reviewed-on: http://gerrit.cloudera.org:8080/7052
Tested-by: Kudu Jenkins
Reviewed-by: Mike Percy <mpercy@apache.org>
Reviewed-by: David Ribeiro Alves <davidralves@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/0f31386d
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/0f31386d
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/0f31386d

Branch: refs/heads/master
Commit: 0f31386d26ffe614a66f5bc57f73cfa78f8a326b
Parents: 732ee21
Author: Todd Lipcon <todd@cloudera.com>
Authored: Thu Jun 1 18:20:33 2017 -0700
Committer: Mike Percy <mpercy@apache.org>
Committed: Mon Jun 5 21:05:49 2017 +0000

----------------------------------------------------------------------
 src/kudu/server/generic_service.cc | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/0f31386d/src/kudu/server/generic_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/generic_service.cc b/src/kudu/server/generic_service.cc
index f4562b3..63dd4b2 100644
--- a/src/kudu/server/generic_service.cc
+++ b/src/kudu/server/generic_service.cc
@@ -124,7 +124,21 @@ void GenericServiceImpl::CheckLeaks(const CheckLeaksRequestPB* /*req*/,
 #else
   LOG(INFO) << "Checking for leaks (request via RPC)";
   resp->set_success(true);
-  resp->set_found_leaks(__lsan_do_recoverable_leak_check());
+
+  // Workaround for LSAN issue 757 (leak check can give false positives when
+  // run concurrently with other work). If LSAN reports a leak, we'll retry
+  // a few times and see if it goes away on its own. Any real leak would,
+  // by definition, not resolve itself over time.
+  //
+  // See https://github.com/google/sanitizers/issues/757
+  bool has_leaks = true;
+  for (int i = 0; i < 5; i++) {
+    has_leaks = __lsan_do_recoverable_leak_check();
+    if (!has_leaks) break;
+    SleepFor(MonoDelta::FromMilliseconds(5));
+  }
+
+  resp->set_found_leaks(has_leaks);
 #endif
 #undef LSAN_ENABLED
   rpc->RespondSuccess();


Mime
View raw message