stack lock release when acquire

Bug #1418360 reported by huangtianhua
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
huangtianhua
Juno
Fix Released
Undecided
huangtianhua

Bug Description

1. create a stack with a nova server
2. the stack in CREATE_IN_PROGRESS, the nova server in BUILD
3. try to update the stack
4. an error raised: ERROR: Stack ic already has an action (CREATE) in progress.
5. describe: stack in CREATE_IN_PROGRESS and the nova server in BUILD still
6. try to update again
7. then the stack change to UPDATE_FAILED

excepted: The step7 should raise the error as step4
I found in step4, the stack and engine lock is released due to the exception, and I think it's incorrect.
########################
@contextlib.contextmanager
def thread_lock(self, stack_id):
      try:
            self.acquire()
            yield
        except: # noqa
            with excutils.save_and_reraise_exception():
                self.release(stack_id)
#################

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

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

Reviewed: https://review.openstack.org/153186
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=00c599319577730fcd085d9645fbe14a7f61c4ee
Submitter: Jenkins
Branch: master

commit 00c599319577730fcd085d9645fbe14a7f61c4ee
Author: huangtianhua <email address hidden>
Date: Thu Feb 5 15:29:54 2015 +0800

    Release stack lock when successfully acquire

    Should not to release the stack lock if acquire failed,
    such as stack action in progress.

    Change-Id: I2a519c47306065b0a3412a8c6faa64006dea691f
    Closes-Bug: #1418360

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

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/161144

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

Reviewed: https://review.openstack.org/161144
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=691a06adb2f241fdbc8ca887ccc553c1f184ece7
Submitter: Jenkins
Branch: stable/juno

commit 691a06adb2f241fdbc8ca887ccc553c1f184ece7
Author: huangtianhua <email address hidden>
Date: Thu Feb 5 15:29:54 2015 +0800

    Release stack lock when successfully acquire

    Should not to release the stack lock if acquire failed,
    such as stack action in progress.

    Change-Id: I2a519c47306065b0a3412a8c6faa64006dea691f
    Closes-Bug: #1418360
    (cherry picked from commit 00c599319577730fcd085d9645fbe14a7f61c4ee)

tags: added: in-stable-juno
Thierry Carrez (ttx)
Changed in heat:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-3 → 2015.1.0
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.