From 6252069be09a32959eb1e9b313e4ba17e4131db4 Mon Sep 17 00:00:00 2001 From: Stan Lagun Date: Mon, 15 Sep 2014 18:34:53 +0400 Subject: [PATCH] Fixes stealing of agent responses in some cases When deployment of environment fails with exception AgentListener.stop() is not called and thus there remains a listener for RabbitMQ response queue. Besides being a resource leak it introduces another problems: when that environment get redeployed it becomes 2 listeners on the same queue and responses from agents may be stolen by zombie listener making workflow wait forever or response (hang deployment) Change-Id: Ic4cedd323ab7b55690d095ed8addcb0dc3e335a7 Closes-Bug: #1369589 --- meta/io.murano/Classes/Environment.yaml | 16 +++++++++------- murano/dsl/executor.py | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/meta/io.murano/Classes/Environment.yaml b/meta/io.murano/Classes/Environment.yaml index 1b000d54..c8711eb5 100644 --- a/meta/io.murano/Classes/Environment.yaml +++ b/meta/io.murano/Classes/Environment.yaml @@ -59,13 +59,15 @@ Methods: deploy: Usage: Action Body: - - $.agentListener.start() - - If: len($.applications) = 0 - Then: - - $.stack.delete() - Else: - - $.applications.pselect($.deploy()) - - $.agentListener.stop() + Try: + - $.agentListener.start() + - If: len($.applications) = 0 + Then: + - $.stack.delete() + Else: + - $.applications.pselect($.deploy()) + Finally: + - $.agentListener.stop() destroy: Body: diff --git a/murano/dsl/executor.py b/murano/dsl/executor.py index cdcc1c08..a259fdf9 100644 --- a/murano/dsl/executor.py +++ b/murano/dsl/executor.py @@ -14,6 +14,7 @@ import collections import inspect +import sys import types import uuid @@ -171,7 +172,7 @@ class MuranoDslExecutor(object): return body(**params) except Exception as e: raise dsl_exception.MuranoPlException.from_python_exception( - e, context) + e, context), None, sys.exc_info()[2] elif isinstance(body, expressions.DslExpression): return self.execute( body, murano_class, this, context, **params)