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 a699b7d55a2ac1eb40599e9d908fa80bec352baf
Author: Benjamin Mahler <[email protected]>
AuthorDate: Tue Feb 11 15:50:27 2020 -0500

    Fixed incorrect task count logging in master's agent draining logic.
    
    The code was incorrectly printing the framework count, since these
    are hashmap<FrameworkID, hashmap<TaskID, Task>>.
    
    Review: https://reviews.apache.org/r/72116
---
 src/master/master.cpp | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/master/master.cpp b/src/master/master.cpp
index 6d45c4e..36a81cc 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5851,10 +5851,20 @@ void Master::checkAndTransitionDrainingAgent(Slave* 
slave)
   if (!slave->pendingTasks.empty() ||
       !slave->tasks.empty() ||
       !slave->operations.empty()) {
+    size_t numTasks = 0u;
+    foreachvalue (const auto& frameworkTasks, slave->tasks) {
+      numTasks += frameworkTasks.size();
+    }
+
+    size_t numPendingTasks = 0u;
+    foreachvalue (const auto& frameworkTasks, slave->pendingTasks) {
+      numPendingTasks += frameworkTasks.size();
+    }
+
     VLOG(1)
       << "DRAINING Agent " << slaveId << " has "
-      << slave->pendingTasks.size() << " pending tasks, "
-      << slave->tasks.size() << " tasks, and "
+      << numPendingTasks << " pending tasks, "
+      << numTasks << " tasks, and "
       << slave->operations.size() << " operations";
     return;
   }

Reply via email to