[openstack-dev] [Heat] Dealing with nonexistent resources during resource-list / stack-delete

Johannes Grassler jgrassler at suse.de
Fri Mar 4 09:35:49 UTC 2016


Hello,

I am currently looking into https://bugs.launchpad.net/heat/+bug/1442121 and
not quite sure how to tackle it, since the problematic code is used for lots of
things[0]: the root cause of the problem are API clients in resource plugins
that do not anticipate a resource with an entry in Heat's database having been
deleted in the implementing service's database[1]. Here's an example:

https://github.com/openstack/heat/blob/e4dc942ce1a8c79b450345c7afae326c80d8a5d6/heat/engine/resources/openstack/neutron/floatingip.py#L179

If that happens[1] an uncaught exception will be thrown that among other things
breaks the very operations one would need for cleaning up the mess.

As far as I can see it, the cleanest way would be to go through all resources
with a fine comb and add exception handling to the API calls in the
add_dependencies() method where it is missing (just return False for any
resource that no longer exists). Or is there a better way?

Cheers,

Johannes

Footnotes:

[0] Whenever a stack's resources are being listed using
     heat.engine.service.list_stack_resources(). resource-list and stack-delete,
     all invoke list_stack_resources()). stack-abandon does so indirectly (it
     appears to trigger stack-delete judging by the log, but it yields the
     desired output, at least in Liberty). These are just the ones I tested,
     there are probably more.

[1] It can happen for a number of reasons, either due to resource dependency
     problems upon stack-delete as it happened in the original bug report or due
     to an operator accidently deleting resources that are managed by Heat.


-- 
Johannes Grassler, Cloud Developer
SUSE Linux GmbH, HRB 21284 (AG Nürnberg)
GF: Felix Imendörffer, Jane Smithard, Graham Norton
Maxfeldstr. 5, 90409 Nürnberg, Germany



More information about the OpenStack-dev mailing list