-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AverageLoad() function panics with "divide by zero" when no members are in the hash ring #19
Labels
bug
Something isn't working
Comments
+1
len(c.members) may be equal to zero |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If there are no members in the hashring, calling the
AverageLoad()
function results in a "divide-by-zero" panic.Example, this will result in a
panic
:The
AverageLoad()
function should check if the number of members is > 0, and if it is not simply return a fixed value (such as 0 or -1).The text was updated successfully, but these errors were encountered: