Retry of nested stack delete has race

Bug #1669608 reported by Zane Bitter
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
In Progress
Medium
Rico Lin

Bug Description

When updating a nested stack that is e.g. in the UPDATE_FAILED state, we check the timestamp when polling the child status to avoid a race where we may see the status before the child stack becomes UPDATE_IN_PROGRESS again.

There is no such protection for a nested stack in the DELETE_FAILED state. Trying to delete the parent resource again will likely always fail with the same error as last time, since it will see the status before the child stack becomes DELETE_IN_PROGRESS. (A subsequent attempt should work, if the stack was in fact deleted, since the parent will get NotFound when looking for the child status.)

Rico Lin (rico-lin)
Changed in heat:
milestone: pike-1 → pike-2
Rico Lin (rico-lin)
Changed in heat:
milestone: pike-2 → pike-3
Revision history for this message
Al Bailey (albailey1974) wrote :

delete_stack used to always use cast, and now it looks in the code like it always uses call.

I believe the problem is here:
   https://github.com/openstack/heat/blob/master/heat/engine/resources/stack_resource.py#L535

(needs a return statement. Same for the abandon_stack 2 lines above)

  return self.rpc_client().delete_stack(self.context, stack_identity, cast=False)

otherwise delete_nested will immediately proceed to the check_delete method (which detects FAILED) may execute before the handle_delete is able to update the state for the nested stack.

Revision history for this message
Zane Bitter (zaneb) wrote :

No, it needs to return some data in a similar format to what handle_update() does:

https://github.com/openstack/heat/blob/master/heat/engine/resources/stack_resource.py#L484-L486

Rico Lin (rico-lin)
Changed in heat:
milestone: pike-3 → pike-rc1
Rico Lin (rico-lin)
Changed in heat:
assignee: nobody → Rico Lin (rico-lin)
Rabi Mishra (rabi)
Changed in heat:
milestone: pike-rc1 → pike-rc2
Rico Lin (rico-lin)
Changed in heat:
milestone: pike-rc2 → queens-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/508443

Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/509769

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/510359

Rico Lin (rico-lin)
Changed in heat:
milestone: queens-1 → queens-2
Rico Lin (rico-lin)
Changed in heat:
milestone: queens-2 → queens-3
Rico Lin (rico-lin)
Changed in heat:
milestone: queens-3 → queens-rc1
Rico Lin (rico-lin)
Changed in heat:
milestone: queens-rc1 → rocky-1
Revision history for this message
Ethan Lynn (ethanlynn) wrote :

Met this exactly problem at my env. Wondering is there a way to fix it?

Rico Lin (rico-lin)
Changed in heat:
milestone: rocky-1 → rocky-2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.