Comment 2 for bug 1727127

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

Reviewed: https://review.openstack.org/516459
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=b0e18270b4af43452d6c2e229aa76db7ff120980
Submitter: Zuul
Branch: master

commit b0e18270b4af43452d6c2e229aa76db7ff120980
Author: Zane Bitter <email address hidden>
Date: Mon Oct 30 17:07:12 2017 -0400

    Protect prepare_update_replace() with resource lock

    When we consolidated resource locking with resource state transitions in
    a7376f7494b310e9367ebe5dcb43b432a4053023, prepare_update_replace() moved
    outside of the locked section, so that other update operations could
    potentially conflict with it. This change ensures that we call it while the
    lock is still held (if we have transitioned the resource to
    UPDATE_IN_PROGRESS, and thus acquired the lock), or that we acquire the
    lock before calling it (if UpdateReplace is raised before attempting to
    update the resource).

    To avoid unnecessary locking and unlocking, we only take the lock if the
    Resource plugin has overridden the default handler method (either
    restore_prev_rsrc() or prepare_for_replace()), since the defaults do
    nothing.

    Change-Id: Ie32836ed643e440143bde8b83aeb4d6159acd034
    Closes-Bug: #1727127