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
(cherry picked from commit ec1801931e
)
This commit is contained in:
parent
a2962689ad
commit
8446f07d50
|
@ -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.common.i18n import _LE
|
||||
|
@ -272,17 +273,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)
|
||||
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)
|
||||
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, is_update):
|
||||
|
|
Loading…
Reference in New Issue