From b16ab75ca6b1283270b3682fdc4428796506b633 Mon Sep 17 00:00:00 2001 From: Lisa Zangrando Date: Mon, 27 Feb 2017 10:17:11 +0100 Subject: [PATCH] Fix a possible shared quota consistency issue It may happen that a VM instance goes in error during the building phase. Although the server is deleted by Synergy, the compute node may not send the notification about the cancellation by leaving the shared quota not consistent. This fix addresses this issue. Bug: #1668199 Change-Id: I9ff9eed7b234117e24ae629fdd3e00ae7ce528cd Sem-Ver: bugfix --- synergy_scheduler_manager/scheduler_manager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/synergy_scheduler_manager/scheduler_manager.py b/synergy_scheduler_manager/scheduler_manager.py index 155020a..0645cb7 100644 --- a/synergy_scheduler_manager/scheduler_manager.py +++ b/synergy_scheduler_manager/scheduler_manager.py @@ -137,6 +137,12 @@ class Notifications(object): LOG.error("cannot delete server %s: %s" % (server_id, ex)) + try: + quota.release(server) + except Exception as ex: + LOG.warn("cannot release server %s " + "(reason=%s)" % (server_id, ex)) + def warn(self, ctxt, publisher_id, event_type, payload, metadata): LOG.debug("Notification WARN: event_type=%s, payload=%s metadata=%s" % (event_type, payload, metadata))