File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
pkg/scheduler/plugins/capacity Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -122,9 +122,13 @@ func (cp *capacityPlugin) OnSessionOpen(ssn *framework.Session) {
122122 exceptReclaimee := allocated .Clone ().Sub (reclaimee .Resreq )
123123 // When scalar resource not specified in deserved such as "pods", we should skip it and consider it as infinity,
124124 // so the following first condition will be true and the current queue will not be reclaimed.
125- if allocated .LessEqual (attr .deserved , api .Infinity ) || ! attr .guarantee .LessEqual (exceptReclaimee , api .Zero ) {
125+ // Skip reclaim in two cases:
126+ // 1. Current allocated <= deserved (queue not over-quota yet)
127+ // 2. Evicting would cause allocated < deserved in any dimension (prevent cyclic eviction)
128+ if allocated .LessEqual (attr .deserved , api .Infinity ) || exceptReclaimee .LessPartly (attr .deserved , api .Zero ) {
126129 continue
127130 }
131+
128132 allocated .Sub (reclaimee .Resreq )
129133 victims = append (victims , reclaimee )
130134 }
You can’t perform that action at this time.
0 commit comments