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

Commit 06c4428

Browse files
committed
Fix wrong caculation for deserved in proportion plugin
1 parent 38ad28b commit 06c4428

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/scheduler/plugins/proportion/proportion.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ func (pp *proportionPlugin) OnSessionOpen(ssn *framework.Session) {
124124
continue
125125
}
126126

127+
oldDeserved := attr.deserved.Clone()
127128
attr.deserved.Add(remaining.Clone().Multi(float64(attr.weight) / float64(totalWeight)))
128129
if !attr.deserved.LessEqual(attr.request) {
129130
attr.deserved = helpers.Min(attr.deserved, attr.request)
@@ -134,7 +135,7 @@ func (pp *proportionPlugin) OnSessionOpen(ssn *framework.Session) {
134135
glog.V(4).Infof("The attributes of queue <%s> in proportion: deserved <%v>, allocate <%v>, request <%v>, share <%0.2f>",
135136
attr.name, attr.deserved, attr.allocated, attr.request, attr.share)
136137

137-
deserved.Add(attr.deserved)
138+
deserved.Add(attr.deserved.Clone().Sub(oldDeserved))
138139
}
139140

140141
remaining.Sub(deserved)

0 commit comments

Comments
 (0)