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 2016/11/23 00:29:03 UTC

[1/5] mesos git commit: Windows: Disable persistent state for Windows master.

Repository: mesos
Updated Branches:
  refs/heads/master c89f571c7 -> fa617bd5b


Windows: Disable persistent state for Windows master.

Many Mesos tests use the master in some form.  Of those, relatively few
strictly require the LevelDB-based storage for the replicated log.
(Only tests with master failover require persistent storage.)

Since we cannot currently compile LevelDB on Windows, and because
running Mesos tests on Windows involves compiling and running the
master, this commit will remove the direct dependency on the LevelDB
storage for Windows builds of the master.

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


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

Branch: refs/heads/master
Commit: 88c22daec2b048f35fd9b273872babe64a51dbf7
Parents: 0d489e4
Author: Alex Clemmer <cl...@gmail.com>
Authored: Tue Nov 22 11:55:17 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Nov 22 13:43:13 2016 -0800

----------------------------------------------------------------------
 src/local/local.cpp | 10 ++++++++++
 src/master/main.cpp | 14 ++++++++++++++
 2 files changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/88c22dae/src/local/local.cpp
----------------------------------------------------------------------
diff --git a/src/local/local.cpp b/src/local/local.cpp
index 2571794..bfb272e 100644
--- a/src/local/local.cpp
+++ b/src/local/local.cpp
@@ -33,7 +33,9 @@
 #include <mesos/slave/resource_estimator.hpp>
 
 #include <mesos/state/in_memory.hpp>
+#ifndef __WINDOWS__
 #include <mesos/state/log.hpp>
+#endif // __WINDOWS__
 #include <mesos/state/protobuf.hpp>
 #include <mesos/state/storage.hpp>
 
@@ -76,9 +78,11 @@
 #include "slave/containerizer/fetcher.hpp"
 
 using namespace mesos::internal;
+#ifndef __WINDOWS__
 using namespace mesos::internal::log;
 
 using mesos::log::Log;
+#endif // __WINDOWS__
 
 using mesos::allocator::Allocator;
 
@@ -123,7 +127,9 @@ namespace internal {
 namespace local {
 
 static Allocator* allocator = nullptr;
+#ifndef __WINDOWS__
 static Log* log = nullptr;
+#endif // __WINDOWS__
 static mesos::state::Storage* storage = nullptr;
 static mesos::state::protobuf::State* state = nullptr;
 static Registrar* registrar = nullptr;
@@ -205,6 +211,7 @@ PID<Master> launch(const Flags& flags, Allocator* _allocator)
 
     if (masterFlags.registry == "in_memory") {
       storage = new mesos::state::InMemoryStorage();
+#ifndef __WINDOWS__
     } else if (masterFlags.registry == "replicated_log") {
       // TODO(vinod): Add support for replicated log with ZooKeeper.
       log = new Log(
@@ -214,6 +221,7 @@ PID<Master> launch(const Flags& flags, Allocator* _allocator)
           masterFlags.log_auto_initialize,
           "registrar/");
       storage = new mesos::state::LogStorage(log);
+#endif // __WINDOWS__
     } else {
       EXIT(EXIT_FAILURE)
         << "'" << masterFlags.registry << "' is not a supported"
@@ -511,8 +519,10 @@ void shutdown()
     delete storage;
     storage = nullptr;
 
+#ifndef __WINDOWS__
     delete log;
     log = nullptr;
+#endif // __WINDOWS__
   }
 }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/88c22dae/src/master/main.cpp
----------------------------------------------------------------------
diff --git a/src/master/main.cpp b/src/master/main.cpp
index 2d2dfb7..fa7ba13 100644
--- a/src/master/main.cpp
+++ b/src/master/main.cpp
@@ -34,7 +34,9 @@
 #include <mesos/module/authorizer.hpp>
 
 #include <mesos/state/in_memory.hpp>
+#ifndef __WINDOWS__
 #include <mesos/state/log.hpp>
+#endif // __WINDOWS__
 #include <mesos/state/protobuf.hpp>
 #include <mesos/state/storage.hpp>
 
@@ -77,7 +79,9 @@
 #include "version/version.hpp"
 
 using namespace mesos::internal;
+#ifndef __WINDOWS__
 using namespace mesos::internal::log;
+#endif // __WINDOWS__
 using namespace mesos::internal::master;
 using namespace zookeeper;
 
@@ -86,7 +90,9 @@ using mesos::MasterInfo;
 using mesos::Parameter;
 using mesos::Parameters;
 
+#ifndef __WINDOWS__
 using mesos::log::Log;
+#endif // __WINDOWS__
 
 using mesos::allocator::Allocator;
 
@@ -99,7 +105,9 @@ using mesos::modules::Anonymous;
 using mesos::modules::ModuleManager;
 
 using mesos::state::InMemoryStorage;
+#ifndef __WINDOWS__
 using mesos::state::LogStorage;
+#endif // __WINDOWS__
 using mesos::state::Storage;
 
 using process::Owned;
@@ -377,10 +385,13 @@ int main(int argc, char** argv)
   LOG(INFO) << "Using '" << allocatorName << "' allocator";
 
   Storage* storage = nullptr;
+#ifndef __WINDOWS__
   Log* log = nullptr;
+#endif // __WINDOWS__
 
   if (flags.registry == "in_memory") {
     storage = new InMemoryStorage();
+#ifndef __WINDOWS__
   } else if (flags.registry == "replicated_log" ||
              flags.registry == "log_storage") {
     // TODO(bmahler): "log_storage" is present for backwards
@@ -429,6 +440,7 @@ int main(int argc, char** argv)
           "registrar/");
     }
     storage = new LogStorage(log);
+#endif // __WINDOWS__
   } else {
     EXIT(EXIT_FAILURE)
       << "'" << flags.registry << "' is not a supported"
@@ -573,7 +585,9 @@ int main(int argc, char** argv)
   delete registrar;
   delete state;
   delete storage;
+#ifndef __WINDOWS__
   delete log;
+#endif // __WINDOWS__
 
   delete contender;
   delete detector;


[2/5] mesos git commit: Fixed header include order in some tests.

Posted by jo...@apache.org.
Fixed header include order in some tests.

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


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

Branch: refs/heads/master
Commit: 0d489e4270d78f758808a38a702e8d98b20cedf6
Parents: c89f571
Author: Neil Conway <ne...@gmail.com>
Authored: Tue Nov 22 11:49:09 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Nov 22 13:43:13 2016 -0800

----------------------------------------------------------------------
 src/tests/containerizer/docker_volume_isolator_tests.cpp | 6 ++++--
 src/tests/containerizer/mesos_containerizer_tests.cpp    | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0d489e42/src/tests/containerizer/docker_volume_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/docker_volume_isolator_tests.cpp b/src/tests/containerizer/docker_volume_isolator_tests.cpp
index 2f21b49..c369b31 100644
--- a/src/tests/containerizer/docker_volume_isolator_tests.cpp
+++ b/src/tests/containerizer/docker_volume_isolator_tests.cpp
@@ -29,10 +29,12 @@
 #include "slave/containerizer/mesos/containerizer.hpp"
 #include "slave/containerizer/mesos/linux_launcher.hpp"
 
-#include "slave/containerizer/mesos/isolators/filesystem/linux.hpp"
 #include "slave/containerizer/mesos/isolators/docker/runtime.hpp"
-#include "slave/containerizer/mesos/isolators/docker/volume/isolator.hpp"
+
 #include "slave/containerizer/mesos/isolators/docker/volume/driver.hpp"
+#include "slave/containerizer/mesos/isolators/docker/volume/isolator.hpp"
+
+#include "slave/containerizer/mesos/isolators/filesystem/linux.hpp"
 
 #include "tests/flags.hpp"
 #include "tests/mesos.hpp"

http://git-wip-us.apache.org/repos/asf/mesos/blob/0d489e42/src/tests/containerizer/mesos_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/mesos_containerizer_tests.cpp b/src/tests/containerizer/mesos_containerizer_tests.cpp
index 5aae23b..fa773c8 100644
--- a/src/tests/containerizer/mesos_containerizer_tests.cpp
+++ b/src/tests/containerizer/mesos_containerizer_tests.cpp
@@ -39,9 +39,9 @@
 
 #include "slave/containerizer/fetcher.hpp"
 
+#include "slave/containerizer/mesos/constants.hpp"
 #include "slave/containerizer/mesos/containerizer.hpp"
 #include "slave/containerizer/mesos/launcher.hpp"
-#include "slave/containerizer/mesos/constants.hpp"
 
 #include "slave/containerizer/mesos/provisioner/provisioner.hpp"
 


[4/5] mesos git commit: Moved server socket deletion in 'process::finalize()'.

Posted by jo...@apache.org.
Moved server socket deletion in 'process::finalize()'.

We need to destroy the server socket and discard its
future before we finalize the process manager
because the socket's `onDiscard` callback may need to
run in the event loop (such as for libevent sockets), but
process manager finalization stops the event loop.

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


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

Branch: refs/heads/master
Commit: 5efc83f4937d6b03e66995fa15be01f63fd24fb1
Parents: e1c9072
Author: Greg Mann <gr...@mesosphere.io>
Authored: Tue Nov 22 13:46:06 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Nov 22 13:46:06 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/process.cpp | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5efc83f4/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index b5ee0b3..47341f7 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -1198,6 +1198,18 @@ void finalize()
   delete processes_route;
   processes_route = nullptr;
 
+  // Close the server socket.
+  // This will prevent any further connections managed by the `SocketManager`.
+  synchronized (socket_mutex) {
+    // Explicitly terminate the callback loop used to accept incoming
+    // connections. This is necessary as the server socket ignores
+    // most errors, including when the server socket has been closed.
+    future_accept.discard();
+
+    delete __s__;
+    __s__ = nullptr;
+  }
+
   // Terminate all running processes and prevent further processes from
   // being spawned. This will also clean up any metadata for running
   // processes held by the `SocketManager`. After this method returns,
@@ -1213,18 +1225,6 @@ void finalize()
   // stopped, no timers will fire.
   Clock::finalize();
 
-  // Close the server socket.
-  // This will prevent any further connections managed by the `SocketManager`.
-  synchronized (socket_mutex) {
-    // Explicitly terminate the callback loop used to accept incoming
-    // connections. This is necessary as the server socket ignores
-    // most errors, including when the server socket has been closed.
-    future_accept.discard();
-
-    delete __s__;
-    __s__ = nullptr;
-  }
-
   // Clean up the socket manager.
   // Terminating processes above will also clean up any links between
   // processes (which may be expressed as open sockets) and the various


[5/5] mesos git commit: Fix SSL downgrade pathway for temporary/persistent sockets.

Posted by jo...@apache.org.
Fix SSL downgrade pathway for temporary/persistent sockets.

This fixes some potential CHECK failures when a libprocess process
has (1) SSL downgrade enabled and (2) temporary and persistent
connections open with the same remote address.  The second point is
only possible if messages are to a remote address without a persistent
connection and then a persistent connection is created.

The SSL downgrade path was only checking if the address of a socket
matched when performing the downgrade.  The code must also check to
see if the socket itself matches.

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


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

Branch: refs/heads/master
Commit: fa617bd5b542c607205d96a6b00beda75dc5fdca
Parents: 5efc83f
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Tue Nov 22 13:55:17 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Nov 22 13:58:45 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/fa617bd5/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index 47341f7..a2382ef 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -2497,16 +2497,16 @@ void SocketManager::swap_implementing_socket(
     addresses[to_fd] = addresses[from_fd];
     addresses.erase(from_fd);
 
-    // If this address is a temporary link.
-    if (temps.count(addresses[to_fd]) > 0) {
-      temps[addresses[to_fd]] = to_fd;
-      // No need to erase as we're changing the value, not the key.
-    }
-
-    // If this address is a persistent link.
-    if (persists.count(addresses[to_fd]) > 0) {
+    // If this address is a persistent or temporary link
+    // that matches the original FD.
+    if (persists.count(addresses[to_fd]) > 0 &&
+        persists.at(addresses[to_fd]) == from_fd) {
       persists[addresses[to_fd]] = to_fd;
       // No need to erase as we're changing the value, not the key.
+    } else if (temps.count(addresses[to_fd]) > 0 &&
+        temps.at(addresses[to_fd]) == from_fd) {
+      temps[addresses[to_fd]] = to_fd;
+      // No need to erase as we're changing the value, not the key.
     }
 
     // Move any encoders queued against this link to the new socket.


[3/5] mesos git commit: Added missing cleanup to libprocess 'finalize()'.

Posted by jo...@apache.org.
Added missing cleanup to libprocess 'finalize()'.

The `finalize()` function in libprocess previously did
not delete the thread-local `Executor` which is used to
defer execution to an unspecified context. This object
must be deleted during finalization so that the
`__executor__` macro creates a new process if libprocess
is subsequently reinitialized (and to not leak the pointer).

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


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

Branch: refs/heads/master
Commit: e1c90722fa3c206a42000ced602dfdf4e7932141
Parents: 88c22da
Author: Greg Mann <gr...@mesosphere.io>
Authored: Tue Nov 22 13:44:59 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Tue Nov 22 13:44:59 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/e1c90722/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index 84971fa..b5ee0b3 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -1204,6 +1204,11 @@ void finalize()
   // libprocess should be single-threaded.
   process_manager->finalize();
 
+  // Now that all threads except for the main thread have joined, we should
+  // delete the one remaining `_executor_` pointer.
+  delete _executor_;
+  _executor_ = nullptr;
+
   // This clears any remaining timers. Because the event loop has been
   // stopped, no timers will fire.
   Clock::finalize();
@@ -2661,6 +2666,11 @@ long ProcessManager::init_threads()
         }
         process_manager->resume(process);
       } while (true);
+
+      // Threads are joining. Delete the thread local `_executor_`
+      // pointer to prevent a memory leak.
+      delete _executor_;
+      _executor_ = nullptr;
     }
 
     // We hold a constant reference to `joining_threads` to make it clear that