lua-resty-balancer
lua-resty-balancer copied to clipboard
find method may throw error after set due to nil value in current_weights
When using SWRR mode, calling set(id, new_weight) for a new node that didn’t exist before can cause the find method to fail because current_weights[id] is nil.
This happens since set only updates nodes but does not initialize current_weights for the new node.