blindsidenetworks / scalelite

Scalable load balancer for BigBlueButton.
GNU Affero General Public License v3.0
465 stars 249 forks source link

Improvements to loop in server find_available #1052

Closed Ithanil closed 2 months ago

Ithanil commented 3 months ago

In server find_available, get server_load set only once and iterate through it until server with valid hash is found.

Description

In server find_available, only retrieve the server_load via zrange once (but get the whole range instead of only first element) and iterate through it until a valid server is found. In my opinion this is a much more sane approach than the (kinda arbitrary) 5-times loop which always used the first element in the repeatedly obtained zrange. Furthermore, this would slim down the implementation in https://github.com/blindsidenetworks/scalelite/pull/1049.

Testing Steps

Existing automated tests + testing in actual deployment.

Notes