You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-scheduling/5142-pop-backoffq-when-activeq-empty/README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,12 @@ tags, and then generate with `hack/update-toc.sh`.
27
27
-[A tiny delay on the first scheduling attempts for newly created pods](#a-tiny-delay-on-the-first-scheduling-attempts-for-newly-created-pods)
28
28
-[Backoff won't be working as a natural rate limiter in case of errors](#backoff-wont-be-working-as-a-natural-rate-limiter-in-case-of-errors)
29
29
-[One pod in the backoffQ could starve the others](#one-pod-in-the-backoffq-could-starve-the-others)
30
+
-[Low priority pod could be chosen to pop, even if high priority pod has a slightly later backoff expiration](#low-priority-pod-could-be-chosen-to-pop-even-if-high-priority-pod-has-a-slightly-later-backoff-expiration)
30
31
-[Design Details](#design-details)
31
32
-[Popping from the backoffQ in activeQ's pop()](#popping-from-the-backoffq-in-activeqs-pop)
32
33
-[Notifying activeQ condition when a new pod appears in the backoffQ](#notifying-activeq-condition-when-a-new-pod-appears-in-the-backoffq)
33
34
-[Calling PreEnqueue for the backoffQ](#calling-preenqueue-for-the-backoffq)
35
+
-[Change backoffQ less function](#change-backoffq-less-function)
@@ -177,7 +179,7 @@ Flushing from backoffQ to activeQ is done each second, taking all pods with back
177
179
It means that, when they come to activeQ, they are sorted by priority there and taken in this order from activeQ.
178
180
It is important, because preemption of a lower priority pod could happen if a higher priority pod is scheduled later.
179
181
180
-
To mitigate this, key function of backoffQ's heap will be changed, quantifying the time to make one second windows in which pods will be sorted by priority.
182
+
To mitigate this, `lessFn` function of backoffQ's heap will be changed, quantifying the time to make one second windows in which pods will be sorted by priority.
181
183
Those whole windows will be eventually flushed to activeQ, making no change in current behavior.
182
184
183
185
## Design Details
@@ -211,10 +213,10 @@ Also, it means we'd have two paths that `PreEnqueue` plugins are invoked: when n
211
213
and when pods are pushed into the backoffQ.
212
214
At the moveToActiveQ level, these two paths could be distinguished by checking if the event is equal to `BackoffComplete`.
213
215
214
-
### Change backoffQ key function
216
+
### Change backoffQ less function
215
217
216
218
As [mentioned](#low-priority-pod-could-be-chosen-to-pop-even-if-high-priority-pod-has-a-slightly-later-backoff-expiration) in risks,
217
-
backoffQ's heap key function has to be changed to apply priority within 1 second windows.
219
+
backoffQ's heap `lessFn` function has to be changed to apply priority within 1 second windows.
218
220
The actual implementation takes backoff expiration times of two pods and compares which is lower.
219
221
The new version will cut the milliseconds and use priorities to compare pods within those windows.
220
222
To make ordering predictable, in case of equal priorities within the same window,
0 commit comments