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

mzhu pushed a commit to branch 1.6.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 80ef788583bc9a5992b52db4688fee613a9c9dd6
Author: Meng Zhu <m...@mesosphere.io>
AuthorDate: Mon May 13 15:58:43 2019 +0200

    Avoided logging quota headroom info when there is no quota set.
    
    Review: https://reviews.apache.org/r/70633
---
 src/master/allocator/mesos/hierarchical.cpp | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/master/allocator/mesos/hierarchical.cpp 
b/src/master/allocator/mesos/hierarchical.cpp
index 1c11a3f..302cacd 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -1734,9 +1734,11 @@ void HierarchicalAllocatorProcess::__allocate()
       slave.getAvailable().revocable().createStrippedScalarQuantity();
   }
 
-  LOG(INFO) << "Before allocation, required quota headroom is "
-            << requiredHeadroom
-            << " and available quota headroom is " << availableHeadroom;
+  if (!quotas.empty()) {
+    LOG(INFO) << "Before allocation, required quota headroom is "
+              << requiredHeadroom
+              << " and available quota headroom is " << availableHeadroom;
+  }
 
   // Due to the two stages in the allocation algorithm and the nature of
   // shared resources being re-offerable even if already allocated, the
@@ -2172,11 +2174,13 @@ void HierarchicalAllocatorProcess::__allocate()
     }
   }
 
-  LOG(INFO) << "After allocation, " << requiredHeadroom
-            << " are required for quota headroom, "
-            << heldBackForHeadroom << " were held back from "
-            << heldBackAgentCount
-            << " agents to ensure sufficient quota headroom";
+  if (!quotas.empty()) {
+    LOG(INFO) << "After allocation, " << requiredHeadroom
+              << " are required for quota headroom, "
+              << heldBackForHeadroom << " were held back from "
+              << heldBackAgentCount
+              << " agents to ensure sufficient quota headroom";
+  }
 
   if (offerable.empty()) {
     VLOG(2) << "No allocations performed";

Reply via email to