Added logging of failed resource provider registry updates.

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


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

Branch: refs/heads/master
Commit: 88f5629e510d71a32bd7e0ff7ee09e150f944e72
Parents: befb4d7
Author: Benjamin Bannier <benjamin.bann...@mesosphere.io>
Authored: Tue Apr 10 17:06:49 2018 +0200
Committer: Benjamin Bannier <bbann...@apache.org>
Committed: Tue Apr 10 17:06:49 2018 +0200

----------------------------------------------------------------------
 src/resource_provider/registrar.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/88f5629e/src/resource_provider/registrar.cpp
----------------------------------------------------------------------
diff --git a/src/resource_provider/registrar.cpp 
b/src/resource_provider/registrar.cpp
index 9eb49f1..92ef9ae 100644
--- a/src/resource_provider/registrar.cpp
+++ b/src/resource_provider/registrar.cpp
@@ -282,7 +282,13 @@ void AgentRegistrarProcess::update()
   Registry updatedRegistry = registry.get();
 
   foreach (Owned<Registrar::Operation>& operation, operations) {
-    (*operation)(&updatedRegistry);
+    Try<bool> operationResult = (*operation)(&updatedRegistry);
+
+    if (operationResult.isError()) {
+      LOG(WARNING)
+        << "Failed to apply operation on resource provider manager registry: "
+        << operationResult.error();
+    }
   }
 
   // Serialize updated registry.

Reply via email to