Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[restart] switch to ready/blocked queues
Summary: The restart scheduler currently allows a rare but possible under-utilisation of workers: If several workers become idle at the same time, and procedures still being locked are near the head of the queue, then there is the possibility that the scheduler will check those, find that they are still locked and return `None` from its `next` function. This means that some workers may end up idling even if there is work further down the queue. This diff uses two queues, ready and blocked, much like a CPU scheduler. A target that is restarted enters the blocked queue, and the blocked queue is traversed entirely every time the ready queue is emptied. This way all idle workers will receive work as early as possible. Reviewed By: geralt-encore, jvillard Differential Revision: D58459783 Privacy Context Container: L1208441 fbshipit-source-id: b5b2df26a1a9f7e09cf5d3da2e8ac0e79a4e5fcf
- Loading branch information