From 700a7cb37c7e63756f931675bc6174d77703967e Mon Sep 17 00:00:00 2001 From: Ekaterina Chernova Date: Thu, 11 Jun 2015 14:11:35 +0300 Subject: [PATCH] Increase default timeout for agents response to 1 hour Makes this parameter configurable and it can be changed in config file and/or in app definitions. Change-Id: I3d5c0d5ff1fe39a8aea0727e5156f6450d96e3d8 Closes-Bug: #1461883 --- murano/common/config.py | 5 ++++- murano/engine/system/agent.py | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/murano/common/config.py b/murano/common/config.py index 2d731827b..6ce4cb0d3 100644 --- a/murano/common/config.py +++ b/murano/common/config.py @@ -201,7 +201,10 @@ engine_opts = [ help=_("Create resources using trust token rather " "than user's token")), cfg.BoolOpt('enable_model_policy_enforcer', default=False, - help=_('Enable model policy enforcer using Congress')) + help=_('Enable model policy enforcer using Congress')), + cfg.IntOpt('agent_timeout', default=3600, + help=_('Time for waiting for a response from murano agent' + 'during the deployment')) ] # TODO(sjmc7): move into engine opts? diff --git a/murano/engine/system/agent.py b/murano/engine/system/agent.py index 545607b2e..b699ad1b7 100644 --- a/murano/engine/system/agent.py +++ b/murano/engine/system/agent.py @@ -22,6 +22,7 @@ import urlparse import uuid import eventlet.event +from oslo_config import cfg import murano.common.config as config import murano.common.exceptions as exceptions @@ -32,6 +33,7 @@ import murano.dsl.yaql_expression as yaql_expression import murano.engine.system.common as common LOG = logging.getLogger(__name__) +CONF = cfg.CONF class AgentException(Exception): @@ -121,7 +123,9 @@ class Agent(murano_object.MuranoObject): else: return None - def call(self, template, resources, _context, timeout=600): + def call(self, template, resources, _context, timeout=None): + if timeout is None: + timeout = CONF.engine.agent_timeout self._check_enabled() plan = self.buildExecutionPlan(template, resources) return self._send(plan, True, timeout, _context) @@ -131,7 +135,9 @@ class Agent(murano_object.MuranoObject): plan = self.buildExecutionPlan(template, resources) return self._send(plan, False, 0, _context) - def callRaw(self, plan, _context, timeout=600): + def callRaw(self, plan, _context, timeout=None): + if timeout is None: + timeout = CONF.engine.agent_timeout self._check_enabled() return self._send(plan, True, timeout, _context)