You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2015/09/29 03:55:52 UTC

mesos git commit: Ignore SIGPIPE in libevent execution thread using SUPPRESS.

Repository: mesos
Updated Branches:
  refs/heads/master 9a675a121 -> e983d6ae3


Ignore SIGPIPE in libevent execution thread using SUPPRESS.

This fixes a Broken Pipe after unblocking SIGPIPE.

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


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

Branch: refs/heads/master
Commit: e983d6ae3cdad25d60520daf76e6ad37533abe4d
Parents: 9a675a1
Author: Joris Van Remoortere <jo...@gmail.com>
Authored: Mon Sep 28 14:25:29 2015 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Mon Sep 28 18:54:37 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/src/libevent.cpp | 40 +++++++++++++------------------
 1 file changed, 17 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e983d6ae/3rdparty/libprocess/src/libevent.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libevent.cpp b/3rdparty/libprocess/src/libevent.cpp
index 00e0f08..7b4299d 100644
--- a/3rdparty/libprocess/src/libevent.cpp
+++ b/3rdparty/libprocess/src/libevent.cpp
@@ -100,32 +100,26 @@ void EventLoop::run()
   // Block SIGPIPE in the event loop because we can not force
   // underlying implementations such as SSL bufferevents to use
   // MSG_NOSIGNAL.
-  bool unblock = os::signals::block(SIGPIPE);
-
-  do {
-    int result = event_base_loop(base, EVLOOP_ONCE);
-    if (result < 0) {
-      LOG(FATAL) << "Failed to run event loop";
-    } else if (result > 0) {
-      // All events are handled, continue event loop.
-      continue;
-    } else {
-      CHECK_EQ(0, result);
-      if (event_base_got_break(base)) {
-        break;
-      } else if (event_base_got_exit(base)) {
-        break;
+  SUPPRESS(SIGPIPE) {
+    do {
+      int result = event_base_loop(base, EVLOOP_ONCE);
+      if (result < 0) {
+        LOG(FATAL) << "Failed to run event loop";
+      } else if (result > 0) {
+        // All events are handled, continue event loop.
+        continue;
+      } else {
+        CHECK_EQ(0, result);
+        if (event_base_got_break(base)) {
+          break;
+        } else if (event_base_got_exit(base)) {
+          break;
+        }
       }
-    }
-  } while (true);
+    } while (true);
+  }
 
   __in_event_loop__ = false;
-
-  if (unblock) {
-    if (!os::signals::unblock(SIGPIPE)) {
-      LOG(FATAL) << "Failure to unblock SIGPIPE";
-    }
-  }
 }