Avoid query plan changing during iteration
This commit is contained in:
@@ -40,7 +40,7 @@ class RoundRobinPolicy(LoadBalancingPolicy):
|
|||||||
length = len(self._live_hosts)
|
length = len(self._live_hosts)
|
||||||
if length:
|
if length:
|
||||||
pos %= length
|
pos %= length
|
||||||
return islice(cycle(self._live_hosts), pos, pos + length)
|
return list(islice(cycle(self._live_hosts), pos, pos + length))
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user