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/06/30 02:24:55 UTC

[1/2] mesos git commit: Add CHECKs above SocketManager emplacements.

Repository: mesos
Updated Branches:
  refs/heads/master 04606de09 -> 31d2cca8d


Add CHECKs above SocketManager emplacements.

Technically, `map::emplace` will not insert if an element already
exists.  The CHECK makes sense because the SocketManager should never
implicitly replace an element in it `sockets` array.

Follow up to review: https://reviews.apache.org/r/49404/


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

Branch: refs/heads/master
Commit: b4e659c56d3133f1d78b2c5e8e36d58bf8db02fd
Parents: 04606de
Author: Joseph Wu <jo...@apache.org>
Authored: Wed Jun 29 19:22:59 2016 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jun 29 19:22:59 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/b4e659c5/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index e2d09e4..9a31702 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -1389,6 +1389,7 @@ SocketManager::~SocketManager() {}
 void SocketManager::accepted(const Socket& socket)
 {
   synchronized (mutex) {
+    CHECK(sockets.count(socket) == 0);
     sockets.emplace(socket, socket);
   }
 }
@@ -1553,7 +1554,9 @@ void SocketManager::link(
         socket = create.get();
         int s = socket.get().get();
 
+        CHECK(sockets.count(s) == 0);
         sockets.emplace(s, socket.get());
+
         addresses[s] = to.address;
 
         persists[to.address] = s;
@@ -1577,15 +1580,11 @@ void SocketManager::link(
 
         socket = create.get();
 
-        // Grab a copy of the existing socket that we're swapping.
-        // This should go out of scope and be closed after the swap
-        // is complete.
-        Socket existing(sockets.at(persists.at(to.address)));
-
         // Update all the data structures that are mapped to the old
         // socket. They will now point to the new socket we are about
         // to try to connect. The old socket should no longer have any
         // references after the swap and should be closed.
+        Socket existing(sockets.at(persists.at(to.address)));
         swap_implementing_socket(existing, socket.get());
 
         connect = true;
@@ -1922,7 +1921,9 @@ void SocketManager::send(Message* message, const Socket::Kind& kind)
       socket = create.get();
       int s = socket.get();
 
+      CHECK(sockets.count(s) == 0);
       sockets.emplace(s, socket.get());
+
       addresses[s] = address;
       temps[address] = s;
 
@@ -2017,7 +2018,7 @@ Encoder* SocketManager::next(int s)
 
           Try<Nothing> shutdown = socket.shutdown();
           if (shutdown.isError()) {
-            LOG(ERROR) << "Failed to shutdown socket with fd " << socket
+            LOG(ERROR) << "Failed to shutdown socket with fd " << socket.get()
                        << ": " << shutdown.error();
           }
         }
@@ -2100,7 +2101,7 @@ void SocketManager::close(int s)
 
       Try<Nothing> shutdown = socket.shutdown();
       if (shutdown.isError()) {
-        LOG(ERROR) << "Failed to shutdown socket with fd " << socket
+        LOG(ERROR) << "Failed to shutdown socket with fd " << socket.get()
                    << ": " << shutdown.error();
       }
     }


[2/2] mesos git commit: Fixed Cmake build.

Posted by jo...@apache.org.
Fixed Cmake build.

In a previous commit we renamed 'nvidia.cpp' to 'isolator.cpp' in
'src/slave/containerizer/mesos/isolators/gpu/', but forgot to update
the Cmake build with this rename.

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


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

Branch: refs/heads/master
Commit: 31d2cca8d89c7eb6e5da00c5ec5428e004e1ddfd
Parents: b4e659c
Author: Kevin Klues <kl...@gmail.com>
Authored: Wed Jun 29 19:23:33 2016 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Jun 29 19:23:33 2016 -0700

----------------------------------------------------------------------
 src/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/31d2cca8/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9c80a61..996d9e6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -168,7 +168,7 @@ set(LINUX_SRC
   slave/containerizer/mesos/isolators/filesystem/linux.cpp
   slave/containerizer/mesos/isolators/filesystem/shared.cpp
   slave/containerizer/mesos/isolators/gpu/allocator.cpp
-  slave/containerizer/mesos/isolators/gpu/nvidia.cpp
+  slave/containerizer/mesos/isolators/gpu/isolator.cpp
   slave/containerizer/mesos/isolators/gpu/nvml.cpp
   slave/containerizer/mesos/isolators/namespaces/pid.cpp
   slave/containerizer/mesos/isolators/network/cni/cni.cpp