You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2014/08/28 01:17:22 UTC

[2/3] git commit: Fixed signal handling in libprocess.

Fixed signal handling in libprocess.

Review: https://reviews.apache.org/r/25128


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0386b6ef
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0386b6ef
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0386b6ef

Branch: refs/heads/master
Commit: 0386b6ef3fa4fea20d1f5de7b6c8c02b1e21967e
Parents: 1f695fa
Author: Vinod Kone <vi...@gmail.com>
Authored: Wed Aug 27 15:53:07 2014 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Wed Aug 27 15:53:55 2014 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/src/tests/main.cpp | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0386b6ef/3rdparty/libprocess/src/tests/main.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/main.cpp b/3rdparty/libprocess/src/tests/main.cpp
index 57269cb..0a3ba4e 100644
--- a/3rdparty/libprocess/src/tests/main.cpp
+++ b/3rdparty/libprocess/src/tests/main.cpp
@@ -1,3 +1,5 @@
+#include <signal.h>
+
 #include <glog/logging.h>
 
 #include <gmock/gmock.h>
@@ -8,7 +10,7 @@
 #include <process/gtest.hpp>
 #include <process/process.hpp>
 
-#include <stout/glog.hpp>
+#include <stout/os/signals.hpp>
 
 int main(int argc, char** argv)
 {
@@ -18,10 +20,13 @@ int main(int argc, char** argv)
   // Initialize libprocess.
   process::initialize();
 
-  // Install default signal handler.
-  // TODO(jieyu): We temporarily disable this since it causes some
-  // flaky tests. Re-enable it once we find the root cause.
-  installFailureSignalHandler();
+  // Install GLOG's signal handler.
+  google::InstallFailureSignalHandler();
+
+  // We reset the GLOG's signal handler for SIGTERM because
+  // 'SubprocessTest.Status' sends SIGTERM to a subprocess which
+  // results in a stack trace otherwise.
+  os::signals::reset(SIGTERM);
 
   // Add the libprocess test event listeners.
   ::testing::TestEventListeners& listeners =