Commit 0d730682 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Simplify cleanup of locks



Since, from stable-2.12 onwards, locks are no longer explicitly
added and removed, there is no need to release them separately.
The freeing of all locks of the level left will take care of this
anyway.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent bb38965c
......@@ -517,18 +517,7 @@ class Processor(object):
calc_timeout())
lu.wconfdlocks = self.wconfd.Client().ListLocks(self._wconfdcontext)
try:
result = self._LockAndExecLU(lu, level + 1, calc_timeout)
finally:
if level in lu.remove_locks:
remove_locks = _LockList(lu.remove_locks[level])
levelname = locking.LEVEL_NAMES[level]
request = [["%s/%s" % (levelname, lock), "release"]
for lock in remove_locks]
blocked = \
self.wconfd.Client().TryUpdateLocks(self._wconfdcontext,
request)
assert blocked == [], "Release may not fail"
result = self._LockAndExecLU(lu, level + 1, calc_timeout)
finally:
levelname = locking.LEVEL_NAMES[level]
logging.debug("Freeing locks at level %s for %s",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment