From 06f4f858715f89100644867a1aad95bdb3352e41 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Tue, 26 Feb 2013 09:16:12 +1100 Subject: [PATCH] Make the alarm actions run in one thread bug #1131024 Change-Id: I678d8919a17fc73350ec9061ad2a7234e1d6b9f6 --- heat/engine/service.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/heat/engine/service.py b/heat/engine/service.py index 78d10d05..8806dfb4 100644 --- a/heat/engine/service.py +++ b/heat/engine/service.py @@ -28,7 +28,6 @@ from heat.common import exception from heat.common import identifier from heat.engine import parser from heat.engine import resource -from heat.engine import resources from heat.engine import watchrule from heat.openstack.common import log as logging @@ -513,11 +512,16 @@ class EngineService(service.Service): logger.warn('periodic_task db error (%s) %s' % ('watch rule removed?', str(ex))) return + + def run_alarm_action(actions): + for action in actions: + action() + for wr in wrs: rule = watchrule.WatchRule.load(stack_context, watch=wr) actions = rule.evaluate() - for action in actions: - self._start_in_thread(sid, action) + if actions: + self._start_in_thread(sid, run_alarm_action, actions) @request_context def create_watch_data(self, context, watch_name, stats_data): -- 2.45.2