lua-resty-balancer icon indicating copy to clipboard operation
lua-resty-balancer copied to clipboard

find method may throw error after set due to nil value in current_weights

Open djx30103 opened this issue 1 year ago • 0 comments

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.

djx30103 avatar Aug 22 '25 01:08 djx30103