From c713cc5d642b6bd3d35e6b1b62b214a93dea6763 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Fri, 12 May 2017 16:36:42 -0400 Subject: [PATCH] Yield to other greenthreads during validation Validating a large stack locks up a whole worker until it is complete, because it doesn't co-operate in greenlet's co-operative multithreading. With this change, we now yield the flow of control between each resource, so that validation can't monopolise the process. Validation is high priority because it happens synchronously, but it is probably worth the trade-off to avoid blocking anything else happening on the same worker. Change-Id: I8514640135a915791a0905eea40ef70876ae1cb1 --- heat/engine/stack.py | 1 + 1 file changed, 1 insertion(+) diff --git a/heat/engine/stack.py b/heat/engine/stack.py index f8574064c9..eabb16d862 100644 --- a/heat/engine/stack.py +++ b/heat/engine/stack.py @@ -864,6 +864,7 @@ class Stack(collections.Mapping): message=encodeutils.safe_decode(six.text_type(ex))) if result: raise exception.StackValidationFailed(message=result) + eventlet.sleep(0) for op_name, output in six.iteritems(self.outputs): try: