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
This commit is contained in:
Stan Lagun 2014-09-15 18:34:53 +04:00
parent 3b70e82676
commit 6252069be0
2 changed files with 11 additions and 8 deletions

View File

@ -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:

View File

@ -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)