Exceptions in prepare_for_replace/restore_prev_rsrc are not caught

Bug #1512496 reported by Zane Bitter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
huangtianhua

Bug Description

Bug 1509977 describes an issue where an exception occurs in the prepare_for_replace() handler of a resource type. This exception does not get caught anywhere, with the result that the stack gets stuck in the UPDATE_IN_PROGRESS state. The bug report points out that once bug 1492433 is fixed, the exception will be caught by the stack and therefore it will not get stuck.

This is, however, insufficient. The exception should be caught by the Resource so that the failure is recorded as a failure of that particular resource, and the resource is put into the FAILED state. The code is currently structured so that there is no exception handling at all around this method call.

Zane Bitter (zaneb)
Changed in heat:
status: New → Triaged
importance: Undecided → High
summary: - Exceptions is prepare_for_replace are not caught
+ Exceptions in prepare_for_replace/restore_prev_rsrc are not caught
tags: added: liberty-backport-potential
Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
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/241084

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

Reviewed: https://review.openstack.org/241084
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=96f7c545ee069debcc22f25770aa0c351ec0ee7c
Submitter: Jenkins
Branch: master

commit 96f7c545ee069debcc22f25770aa0c351ec0ee7c
Author: huangtianhua <email address hidden>
Date: Tue Nov 3 11:59:17 2015 +0800

    Catch exceptions for restore_prev_rsrc/prepare_for_replace

    Catch exceptions when calling restore_prev_rsrc or
    prepare_for_replace, to make sure the failure will be
    recorded and the resource will put into FAILED state.

    Change-Id: If65953d6b8cbdc135d898119c0f43a133f2e1892
    Closes-Bug: #1512496

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/243428

tags: added: kilo-backport-potential
Revision history for this message
Zane Bitter (zaneb) wrote :

There is no Kilo backport potential because these methods did not exist in Kilo.

tags: removed: kilo-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/liberty)

Reviewed: https://review.openstack.org/243428
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=04f57ac4a45fdd04c341e6a582279c0eb66e2c78
Submitter: Jenkins
Branch: stable/liberty

commit 04f57ac4a45fdd04c341e6a582279c0eb66e2c78
Author: huangtianhua <email address hidden>
Date: Tue Nov 3 11:59:17 2015 +0800

    Catch exceptions for restore_prev_rsrc/prepare_for_replace

    Catch exceptions when calling restore_prev_rsrc or
    prepare_for_replace, to make sure the failure will be
    recorded and the resource will put into FAILED state.

    Closes-Bug: #1512496
    (cherry picked from commit 96f7c545ee069debcc22f25770aa0c351ec0ee7c)

    Conflicts:
     heat/engine/resource.py
     heat/tests/test_resource.py

    Change-Id: If65953d6b8cbdc135d898119c0f43a133f2e1892

tags: added: in-stable-liberty
Changed in heat:
milestone: none → mitaka-1
tags: removed: liberty-backport-potential
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/heat 6.0.0.0b1

This issue was fixed in the openstack/heat 6.0.0.0b1 development milestone.

Changed in heat:
status: Fix Committed → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/heat 5.0.1

This issue was fixed in the openstack/heat 5.0.1 release.

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/325792

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/325792
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=3bdd2cb95a602582b718eddcfea16ad83e0ff198
Submitter: Jenkins
Branch: master

commit 3bdd2cb95a602582b718eddcfea16ad83e0ff198
Author: Anant Patil <email address hidden>
Date: Mon Jun 6 14:51:13 2016 +0530

    Convergence: Catch exceptions in restore_prev_rsrc

    Handle exceptions thrown in restore_prev_rsrc.

    Change-Id: I047ff6c3acd8d34ea2540f9ba2fbf076a9d6d55c
    Closes-Bug: #1512496

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/heat 7.0.0.0b2

This issue was fixed in the openstack/heat 7.0.0.0b2 development milestone.

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.