You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2016/09/29 23:48:37 UTC

[2/2] mesos git commit: Added `RecoveryInfo` struct to the agent.

Added `RecoveryInfo` struct to the agent.

This struct would container all the recovery related metadata
on the agent from now on. Eventually, we would add component
specific recovery information to this struct e.g, the executors
can now subscribe again with the agent etc.

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


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

Branch: refs/heads/master
Commit: 6b99555fa808eb32e32c3624704d0971568ca795
Parents: 700f040
Author: Anand Mazumdar <an...@apache.org>
Authored: Thu Sep 29 16:37:53 2016 -0700
Committer: Anand Mazumdar <an...@apache.org>
Committed: Thu Sep 29 16:48:21 2016 -0700

----------------------------------------------------------------------
 src/slave/slave.cpp |  6 +++---
 src/slave/slave.hpp | 12 ++++++++----
 2 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6b99555f/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 46bc8b3..7709def 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -3590,7 +3590,7 @@ void Slave::reregisterExecutorTimeout()
   }
 
   // Signal the end of recovery.
-  recovered.set(Nothing());
+  recoveryInfo.recovered.set(Nothing());
 }
 
 
@@ -5230,7 +5230,7 @@ Future<Nothing> Slave::_recover()
     // We set 'recovered' flag inside reregisterExecutorTimeout(),
     // so that when the slave re-registers with master it can
     // correctly inform the master about the launched tasks.
-    return recovered.future();
+    return recoveryInfo.recovered.future();
   }
 
   return Nothing();
@@ -5331,7 +5331,7 @@ void Slave::__recover(const Future<Nothing>& future)
     // doesn't happen within a timeout.
   }
 
-  recovered.set(Nothing()); // Signal recovery.
+  recoveryInfo.recovered.set(Nothing()); // Signal recovery.
 }
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/6b99555f/src/slave/slave.hpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.hpp b/src/slave/slave.hpp
index 7b414d0..5201e80 100644
--- a/src/slave/slave.hpp
+++ b/src/slave/slave.hpp
@@ -315,6 +315,14 @@ public:
     TERMINATING,  // Slave is shutting down.
   } state;
 
+  // Describes information about agent recovery.
+  struct RecoveryInfo
+  {
+    // Flag to indicate if recovery, including reconciling
+    // (i.e., reconnect/kill) with executors is finished.
+    process::Promise<Nothing> recovered;
+  } recoveryInfo;
+
   // TODO(benh): Clang requires members to be public in order to take
   // their address which we do in tests (for things like
   // FUTURE_DISPATCH).
@@ -728,10 +736,6 @@ private:
   // the master.
   process::Timer pingTimer;
 
-  // Flag to indicate if recovery, including reconciling (i.e., reconnect/kill)
-  // with executors is finished.
-  process::Promise<Nothing> recovered;
-
   // Root meta directory containing checkpointed data.
   const std::string metaDir;