Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
Fix wrong caculation for deserved in proportion plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
zionwu committed Mar 27, 2019
1 parent 38ad28b commit 40c6f18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/scheduler/plugins/proportion/proportion.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ func (pp *proportionPlugin) OnSessionOpen(ssn *framework.Session) {
continue
}

attr.deserved.Add(remaining.Clone().Multi(float64(attr.weight) / float64(totalWeight)))
queueDeserved := remaining.Clone().Multi(float64(attr.weight) / float64(totalWeight))
attr.deserved.Add(queueDeserved)
if !attr.deserved.LessEqual(attr.request) {
attr.deserved = helpers.Min(attr.deserved, attr.request)
meet[attr.queueID] = struct{}{}
Expand All @@ -134,7 +135,7 @@ func (pp *proportionPlugin) OnSessionOpen(ssn *framework.Session) {
glog.V(4).Infof("The attributes of queue <%s> in proportion: deserved <%v>, allocate <%v>, request <%v>, share <%0.2f>",
attr.name, attr.deserved, attr.allocated, attr.request, attr.share)

deserved.Add(attr.deserved)
deserved.Add(queueDeserved)
}

remaining.Sub(deserved)
Expand Down

0 comments on commit 40c6f18

Please sign in to comment.