You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2015/06/04 01:55:31 UTC

[1/2] mesos git commit: Print executor status consistently in the example frameworks.

Repository: mesos
Updated Branches:
  refs/heads/master 796f6a6a0 -> 0607e58b5


Print executor status consistently in the example frameworks.

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


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

Branch: refs/heads/master
Commit: 0607e58b5857a9b5e92f666654b267aa43cf6003
Parents: a3382d4
Author: Benjamin Mahler <be...@gmail.com>
Authored: Tue Jun 2 15:50:13 2015 -0700
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Wed Jun 3 16:45:54 2015 -0700

----------------------------------------------------------------------
 src/examples/low_level_scheduler_libprocess.cpp | 10 ++++------
 src/examples/low_level_scheduler_pthread.cpp    | 10 ++++------
 src/examples/persistent_volume_framework.cpp    |  4 +++-
 3 files changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0607e58b/src/examples/low_level_scheduler_libprocess.cpp
----------------------------------------------------------------------
diff --git a/src/examples/low_level_scheduler_libprocess.cpp b/src/examples/low_level_scheduler_libprocess.cpp
index bd228fd..df92e8d 100644
--- a/src/examples/low_level_scheduler_libprocess.cpp
+++ b/src/examples/low_level_scheduler_libprocess.cpp
@@ -44,6 +44,8 @@
 #include <stout/os.hpp>
 #include <stout/stringify.hpp>
 
+#include "common/status_utils.hpp"
+
 #include "logging/flags.hpp"
 #include "logging/logging.hpp"
 
@@ -165,13 +167,9 @@ public:
             }
 
             if (event.failure().has_status()) {
-              int status = event.failure().status();
-              if (WIFEXITED(status)) {
-                cout << ", and exited with status " << WEXITSTATUS(status);
-              } else {
-                cout << ", and terminated with signal " << WTERMSIG(status);
-              }
+              cout << ", and " << WSTRINGIFY(event.failure().status());
             }
+
             cout << endl;
           } else if (event.failure().has_slave_id()) {
             // Slave failed.

http://git-wip-us.apache.org/repos/asf/mesos/blob/0607e58b/src/examples/low_level_scheduler_pthread.cpp
----------------------------------------------------------------------
diff --git a/src/examples/low_level_scheduler_pthread.cpp b/src/examples/low_level_scheduler_pthread.cpp
index 81388f1..175ee4d 100644
--- a/src/examples/low_level_scheduler_pthread.cpp
+++ b/src/examples/low_level_scheduler_pthread.cpp
@@ -43,6 +43,8 @@
 #include <stout/os.hpp>
 #include <stout/stringify.hpp>
 
+#include "common/status_utils.hpp"
+
 #include "logging/flags.hpp"
 #include "logging/logging.hpp"
 
@@ -186,13 +188,9 @@ public:
             }
 
             if (event.failure().has_status()) {
-              int status = event.failure().status();
-              if (WIFEXITED(status)) {
-                cout << ", and exited with status " << WEXITSTATUS(status);
-              } else {
-                cout << ", and terminated with signal " << WTERMSIG(status);
-              }
+              cout << ", and " << WSTRINGIFY(event.failure().status());
             }
+
             cout << endl;
           } else {
             // Slave failed.

http://git-wip-us.apache.org/repos/asf/mesos/blob/0607e58b/src/examples/persistent_volume_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/persistent_volume_framework.cpp b/src/examples/persistent_volume_framework.cpp
index 6a0c0cb..ee2311f 100644
--- a/src/examples/persistent_volume_framework.cpp
+++ b/src/examples/persistent_volume_framework.cpp
@@ -37,6 +37,8 @@
 #include <stout/stringify.hpp>
 #include <stout/uuid.hpp>
 
+#include "common/status_utils.hpp"
+
 #include "logging/flags.hpp"
 #include "logging/logging.hpp"
 
@@ -313,7 +315,7 @@ public:
       int status)
   {
     LOG(INFO) << "Lost executor '" << executorId << "' on slave "
-              << slaveId << ", status " << status;
+              << slaveId << ", " << WSTRINGIFY(status);
   }
 
   virtual void error(


[2/2] mesos git commit: Fixed a deadlock in libprocess Metrics initialization.

Posted by bm...@apache.org.
Fixed a deadlock in libprocess Metrics initialization.

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


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

Branch: refs/heads/master
Commit: a3382d4e8fb0bba329ef5234293157bb6f2b50f8
Parents: 796f6a6
Author: Benjamin Mahler <be...@gmail.com>
Authored: Tue Jun 2 17:55:19 2015 -0700
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Wed Jun 3 16:45:54 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/src/metrics/metrics.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a3382d4e/3rdparty/libprocess/src/metrics/metrics.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/metrics/metrics.cpp b/3rdparty/libprocess/src/metrics/metrics.cpp
index 38905d3..a97b613 100644
--- a/3rdparty/libprocess/src/metrics/metrics.cpp
+++ b/3rdparty/libprocess/src/metrics/metrics.cpp
@@ -23,6 +23,14 @@ namespace internal {
 
 MetricsProcess* MetricsProcess::instance()
 {
+  // To prevent a deadlock, we must ensure libprocess is
+  // initialized. Otherwise, libprocess will be implicitly
+  // initialized inside the 'once' block below, which in
+  // turns initializes metrics, and we arrive back here
+  // and deadlock by calling 'once()' without allowing
+  // 'done()' to ever be called.
+  process::initialize();
+
   static MetricsProcess* singleton = NULL;
   static Once* initialized = new Once();