Skip to content

Commit

Permalink
Fix queue pruning loop condition (#8431)
Browse files Browse the repository at this point in the history
Fixes a busy loop issue when `executor.queue_trim_interval` is enabled
(>0), since `trimQueue` returns false when nothing was trimmed, which is
the case most of the time.

Reproduced the busy loop issue locally and confirmed that this fixes it.
  • Loading branch information
bduffany committed Feb 18, 2025
1 parent ecb4b58 commit 043d2f1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ func (q *PriorityTaskScheduler) Start() error {
case <-q.rootContext.Done():
return
case <-ticker.Chan():
for exists := q.trimQueue(); !exists; {
for trimmed := q.trimQueue(); trimmed; {
}
}
}
Expand Down

0 comments on commit 043d2f1

Please sign in to comment.