RedisDriver _stop() method doesn't release locks

Bug #1815330 reported by Bob Haddleton on 2019-02-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tooz
Undecided
Bob Haddleton

Bug Description

The RedisDriver _stop() method doesn't release locks because it pop()s them out of the _acquired_locks set before calling lock.release(), and the RedisLock release() method returns False without releasing the lock if it doesn't find the lock in the coordinator's _acquired_locks set.

    def _stop(self):
        while self._acquired_locks:
            lock = self._acquired_locks.pop()
            try:
                lock.release()

RedisLock():
    def release(self):
        with self._exclusive_access:
            if not self.acquired:
                return False
            with _translate_failures():
                try:
                    self._lock.release()

Since the lock has been popped out of the set, it is never released and eventually times out.

This delays the election of a new leader for the group until the lock times out.

Changed in python-tooz:
assignee: nobody → Bob Haddleton (bob-haddleton)
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers