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 06c4428
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/scheduler/plugins/proportion/proportion.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func (pp *proportionPlugin) OnSessionOpen(ssn *framework.Session) {
continue
}

oldDeserved := attr.deserved.Clone()
attr.deserved.Add(remaining.Clone().Multi(float64(attr.weight) / float64(totalWeight)))
if !attr.deserved.LessEqual(attr.request) {
attr.deserved = helpers.Min(attr.deserved, attr.request)
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(attr.deserved.Clone().Sub(oldDeserved))
}

remaining.Sub(deserved)
Expand Down

0 comments on commit 06c4428

Please sign in to comment.