Skip to content

Commit 9fdea50

Browse files
author
Aaron Lehmann
authored
Merge pull request #2032 from aaronlehmann/topology-tree-counts
scheduler: Correctly count tasks at bottom level of decision tree
2 parents deb25d3 + 98505a5 commit 9fdea50

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

manager/scheduler/nodeset.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ func (ns *nodeSet) tree(serviceID string, preferences []*api.PlacementPreference
111111
tree = next
112112
}
113113

114+
if node.ActiveTasksCountByService != nil {
115+
tree.tasks += node.ActiveTasksCountByService[serviceID]
116+
}
117+
114118
if tree.nodeHeap.lessFunc == nil {
115119
tree.nodeHeap.lessFunc = nodeLess
116120
}

0 commit comments

Comments
 (0)