race problem when checking expected_task_state in instance updating
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Wishlist
|
Alex Xu |
Bug Description
When execute some action on instance, instance will update task state first. For example:
When update task_state, it will check the expected_task_state first.
But there is race problem when check the expected task state.
def _instance_
session = get_session()
if not uuidutils.
raise exception.
with session.begin():
if "expected_
# it is not a db column so always pop out
if not isinstance(
<!-----
# If there are two request concurrence for this transaction, second request already modify the instance's task state, but the first request's still get the old state.
# we need use lock for get instance from db
----!>
if actual_state not in expected:
if actual_state == task_states.
Changed in nova: | |
assignee: | nobody → Alex Xu (xuhj) |
tags: | added: compute |
tags: |
added: api removed: compute |
tags: | added: db unified-objects |
tags: | removed: api |
Fix proposed to branch: master /review. openstack. org/80142
Review: https:/