This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 5bb4f28a50f551e67ea9957e1073e464e18f1825
Author: Andrei Sekretenko <[email protected]>
AuthorDate: Mon May 20 14:06:16 2019 -0400

    Made activateRecoveredFramework() return void instead of Try.
    
    The `Master::activateRecoveredFramework()` method always returns
    `Nothing()`. This patch changes its return type to `void` and removes
    the unused error handling code.
    
    Review: https://reviews.apache.org/r/70664/
---
 src/master/master.cpp | 29 +++--------------------------
 src/master/master.hpp |  2 +-
 2 files changed, 4 insertions(+), 27 deletions(-)

diff --git a/src/master/master.cpp b/src/master/master.cpp
index 657a7e9..be606e5 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -2813,19 +2813,8 @@ void Master::_subscribe(
     failoverFramework(framework, http);
   } else {
     // The framework has not yet reregistered after master failover.
-    Try<Nothing> activate = activateRecoveredFramework(
+    activateRecoveredFramework(
         framework, frameworkInfo, None(), http, suppressedRoles);
-
-    if (activate.isError()) {
-      LOG(INFO) << "Could not update FrameworkInfo of framework '"
-                << frameworkInfo.name() << "': " << activate.error();
-
-      FrameworkErrorMessage message;
-      message.set_message(activate.error());
-      http.send(message);
-      http.close();
-      return;
-    }
   }
 
   if (!subscribers.subscribed.empty()) {
@@ -3160,19 +3149,9 @@ void Master::_subscribe(
     }
   } else {
     // The framework has not yet reregistered after master failover.
-    Try<Nothing> activate = activateRecoveredFramework(
+    activateRecoveredFramework(
         framework, frameworkInfo, from, None(), suppressedRoles);
 
-    if (activate.isError()) {
-      LOG(INFO) << "Could not update FrameworkInfo of framework '"
-                << frameworkInfo.name() << "': " << activate.error();
-
-      FrameworkErrorMessage message;
-      message.set_message(activate.error());
-      send(from, message);
-      return;
-    }
-
     if (!subscribers.subscribed.empty()) {
       subscribers.send(
           protobuf::master::event::createFrameworkUpdated(*framework));
@@ -10690,7 +10669,7 @@ void Master::recoverFramework(
 }
 
 
-Try<Nothing> Master::activateRecoveredFramework(
+void Master::activateRecoveredFramework(
     Framework* framework,
     const FrameworkInfo& frameworkInfo,
     const Option<UPID>& pid,
@@ -10767,8 +10746,6 @@ Try<Nothing> Master::activateRecoveredFramework(
     // Start the heartbeat after sending SUBSCRIBED event.
     framework->heartbeat();
   }
-
-  return Nothing();
 }
 
 
diff --git a/src/master/master.hpp b/src/master/master.hpp
index f5161a8..bf7a6b4 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -626,7 +626,7 @@ protected:
   // activate it. This happens at most once after master failover, the
   // first time that the framework reregisters with the new master.
   // Exactly one of `newPid` or `http` must be provided.
-  Try<Nothing> activateRecoveredFramework(
+  void activateRecoveredFramework(
       Framework* framework,
       const FrameworkInfo& frameworkInfo,
       const Option<process::UPID>& pid,

Reply via email to