Commit 73064714 authored by Guido Trotter's avatar Guido Trotter

Add config.DropECReservations

For now this function does nothing, but it gets called by mcpu when the
execution of an LU is done, making sure any pending reservations are
dropped.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent adfa97e3
......@@ -1379,3 +1379,11 @@ class ConfigWriter:
self._temporary_macs.discard(nic.mac)
self._WriteConfig(feedback_fn=feedback_fn)
@locking.ssynchronized(_config_lock)
def DropECReservations(self, ec_id):
"""Drop per-execution-context reservations
"""
pass
......@@ -451,8 +451,13 @@ class Processor(object):
lu.ExpandNames()
assert lu.needed_locks is not None, "needed_locks not set by LU"
return self._LockAndExecLU(lu, locking.LEVEL_INSTANCE,
timeout_strategy.CalcRemainingTimeout)
try:
return self._LockAndExecLU(lu, locking.LEVEL_INSTANCE,
timeout_strategy.CalcRemainingTimeout)
finally:
if self._ec_id:
self.context.cfg.DropECReservations(self._ec_id)
finally:
self.context.glm.release(locking.LEVEL_CLUSTER)
......
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