Repository: incubator-impala
Updated Branches:
  refs/heads/master 5ec1984f5 -> 0b9d2cecd


IMPALA-5291: avoid calling global destructors in statestore-test

The workaround implemented by this patch is to exit the process using
_exit(), which does not run global destructors.

The "proper" solution would be either to change Thrift so that the
destructors are not run unnecessarily on process teardown, or to extend
the statestore services and clients to allow stopping them. It seems the
complexity of neither is justified.

Testing:
Was able to reproduce the bug by running statestore-test in a loop.
After the fix it was not reproducible.

Change-Id: Ic185825cf262311bdc05784ebd541cf53a13cdd6
Reviewed-on: http://gerrit.cloudera.org:8080/6872
Reviewed-by: Matthew Jacobs <[email protected]>
Tested-by: Impala Public Jenkins


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

Branch: refs/heads/master
Commit: 0b9d2cecd7c60841c4be8e880a40e7f3bcaf05d2
Parents: 5ec1984
Author: Tim Armstrong <[email protected]>
Authored: Thu May 11 17:05:07 2017 -0700
Committer: Impala Public Jenkins <[email protected]>
Committed: Fri May 12 05:12:58 2017 +0000

----------------------------------------------------------------------
 be/src/statestore/statestore-test.cc | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/0b9d2cec/be/src/statestore/statestore-test.cc
----------------------------------------------------------------------
diff --git a/be/src/statestore/statestore-test.cc 
b/be/src/statestore/statestore-test.cc
index 8c81383..eb3a540 100644
--- a/be/src/statestore/statestore-test.cc
+++ b/be/src/statestore/statestore-test.cc
@@ -94,4 +94,12 @@ TEST(StatestoreSslTest, SmokeTest) {
 
 }
 
-IMPALA_TEST_MAIN();
+int main(int argc, char** argv) {
+  ::testing::InitGoogleTest(&argc, argv);
+  impala::InitCommonRuntime(argc, argv, false, impala::TestInfo::BE_TEST);
+  int rc = RUN_ALL_TESTS();
+  // IMPALA-5291: statestore services and subscribers may still be running at 
this point
+  // and accessing global state. Exit without running global destructors to 
avoid
+  // races with other threads when tearing down the proces.
+  _exit(rc);
+}

Reply via email to