mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
If naive placer is not instantiated per call/runner group (aka LBG), then the rr index will not trigger an round-robin behavior since the index is initialized and stored in the placer configuration. With this PR, moving rr index to per RunnerPool.Runners() inner loop to ensure a round robin within that set. Each time we fetch a set, since the set might be different, we reset our rr index. This means we rr within that set once, then randomly start from another node for the next RunnerPool.Runners() iteration. In busy systems, no significant behavior change is expected (accept the removal of atomic operations with respect to performance), but in idle systems round robin behavior should be more observable and simple to follow and can reduce same hit cases for the given RunnerPool.Runners(). In addition, introducing naive placer tests to ensure we observe this behavior.