Skip to content

Commit f3fdd5c

Browse files
committed
Add test for windup problem in APF
The current design for Fair Queueing for Server Requests has a problem: if the min-max fair result stays different from an even division for a long time and no queue involved in the imbalance goes empty then the imbalance keeps accruing in queue virtual state times. This commit adds a test that demonstrates the problem. It also has some other tweaks to make other tests less flaky. Factor the big scenario-testing func into pieces, with supporting structs.
1 parent e45a598 commit f3fdd5c

File tree

3 files changed

+451
-139
lines changed

3 files changed

+451
-139
lines changed

staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ func (qs *queueSet) chooseQueueIndexLocked(hashValue uint64, descr1, descr2 inte
441441
bestQueueIdx, bestQueueLen = queueIdx, thisLen
442442
}
443443
})
444-
klog.V(6).Infof("QS(%s): For request %#+v %#+v chose queue %d, had %d waiting & %d executing", qs.qCfg.Name, descr1, descr2, bestQueueIdx, bestQueueLen, qs.queues[bestQueueIdx].requestsExecuting)
444+
klog.V(6).Infof("QS(%s) at r=%s v=%.9fs: For request %#+v %#+v chose queue %d, had %d waiting & %d executing", qs.qCfg.Name, qs.clock.Now().Format(nsTimeFmt), qs.virtualTime, descr1, descr2, bestQueueIdx, bestQueueLen, qs.queues[bestQueueIdx].requestsExecuting)
445445
return bestQueueIdx
446446
}
447447

0 commit comments

Comments
 (0)