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: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
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
+
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)