This is an automated email from the ASF dual-hosted git repository. bmahler pushed a commit to branch 1.9.x in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 5d2ed679438225f61a82681fde8b3dbbbcb826a0 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 73507ce..a99f0eb 100644 --- a/src/master/master.cpp +++ b/src/master/master.cpp @@ -6313,10 +6313,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; }
