As the code say start at line 185 (consistent_hashing.lua) :
local index = handle.hashValue
local ip, port, hostname
while (index - 1) ~= handle.hashValue do
if index == 0 then
index = self.points
end
address = self.continuum[index]
if address ~= nil and address.available and not address.disabled then
...
end
index = index - 1
end
Think about one condition: handle.hashValue = 1, self.points=3 and only self.continuum[2] is available, the code will skip index=2 and return nil.
Beside, when handle.hashValue = 2, self.points=3 and all self.continuum is not available, the code will loop forever!!! I don't know
whether the value of self.healthy is false which can prevent this happen at line 164 on this condition.
As the code say start at line 185 (consistent_hashing.lua) :
Think about one condition: handle.hashValue = 1, self.points=3 and only self.continuum[2] is available, the code will skip index=2 and return nil.
Beside, when handle.hashValue = 2, self.points=3 and all self.continuum is not available, the code will loop forever!!! I don't know whether the value of self.healthy is false which can prevent this happen at line 164 on this condition.