Skip to content

Commit

Permalink
Improve polling in segment allocation queue (#15590)
Browse files Browse the repository at this point in the history
Description
When batchAllocationWaitTime is set to 0, the segment allocation queue is polled continuously even when it is empty. This would take up cpu cycles unnecessarily.

Some existing race conditions would also become more frequent when the batchAllocationWaitTime is 0. This PR tries to better address those race conditions as well.

Changes
Do not reschedule a poll if queue is empty
When a new batch is added to queue, schedule a poll
Simplify keyToBatch map
Handle race conditions better
As soon as a batch starts getting processed, do not add any more requests to it
  • Loading branch information
kfaraz authored Jan 4, 2024
1 parent b9679d0 commit c937068
Showing 1 changed file with 100 additions and 99 deletions.
Loading

0 comments on commit c937068

Please sign in to comment.