Mark stack failed when exception raised in resource check

If we get an unexpected exception when checking a resource, try to clean
up by marking the stack as FAILED. The graph traversal will stop if we
can't propagate any more RPC messages, so without this the stack would
be stuck IN_PROGRESS indefinitely.

Change-Id: I56ecfa7a9a328d1435c1f34ab14e56effb81bb21
Closes-Bug: #1703043
changes/22/487222/1
Zane Bitter 5 years ago
parent 96847a56dd
commit ec1801931e
  1. 31
      heat/engine/check_resource.py

@ -19,6 +19,7 @@ import eventlet.queue
import functools
from oslo_log import log as logging
from oslo_utils import excutils
from heat.common import exception
from heat.engine import resource
@ -280,17 +281,25 @@ class CheckResource(object):
rsrc.current_template_id != tmpl.id):
return
check_resource_done = self._do_check_resource(cnxt, current_traversal,
tmpl, resource_data,
is_update,
rsrc, stack,
adopt_stack_data)
if check_resource_done:
# initiate check on next set of resources from graph
self._initiate_propagate_resource(cnxt, resource_id,
current_traversal, is_update,
rsrc, stack)
try:
check_resource_done = self._do_check_resource(cnxt,
current_traversal,
tmpl, resource_data,
is_update,
rsrc, stack,
adopt_stack_data)
if check_resource_done:
# initiate check on next set of resources from graph
self._initiate_propagate_resource(cnxt, resource_id,
current_traversal, is_update,
rsrc, stack)
except BaseException as exc:
with excutils.save_and_reraise_exception():
msg = six.text_type(exc)
LOG.exception("Unexpected exception in resource check.")
self._handle_resource_failure(cnxt, is_update, rsrc.id,
stack, msg)
def load_resource(cnxt, resource_id, resource_data,

Loading…
Cancel
Save