Skip to content

Commit 5318c5d

Browse files
moritzmoekstiehl
andcommitted
fix: do not hand out item during metrics ascend
Co-authored-by: kstiehl <[email protected]>
1 parent ee91144 commit 5318c5d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/controller/priorityqueue/priorityqueue.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ func (w *priorityqueue[T]) spin() {
239239
}
240240

241241
for {
242+
metricsAscend := false
242243
pivotChange := false
243244

244245
w.queue.AscendGreaterOrEqual(&pivot, func(item *item[T]) bool {
@@ -264,7 +265,8 @@ func (w *priorityqueue[T]) spin() {
264265
}
265266
}
266267

267-
if w.waiters.Load() == 0 {
268+
if w.waiters.Load() == 0 || metricsAscend {
269+
metricsAscend = true
268270
// Have to keep iterating here to ensure we update metrics
269271
// for further items that became ready and set nextReady.
270272
return true

0 commit comments

Comments
 (0)