Ensure lock list isn't mutated while iterating
While iterating over the acquired lock list we do not want the lock.release call to mutate the list that we are currently iterating over. To fix this just iterate over a copy instead so that the lock.release can remove without issue. Change-Id: I157331ca116b97e17d10854b5227ac7ee67fac57
This commit is contained in:
parent
beb73ba651
commit
9b81673302
@ -126,7 +126,7 @@ class MemcachedDriver(coordination.CoordinationDriver):
|
||||
self.heartbeat()
|
||||
|
||||
def stop(self):
|
||||
for lock in self._acquired_locks:
|
||||
for lock in list(self._acquired_locks):
|
||||
lock.release()
|
||||
|
||||
self.client.delete(self._encode_member_id(self._member_id))
|
||||
|
Loading…
Reference in New Issue
Block a user