nova/nova
Matthew Booth aae5c7aa38 Fix retry of instance_update_and_get_original
_instance_update modifies its 'values' argument. Consequently if it is
retried due to an update conflict, the second invocation has the wrong
arguments.

A specific issue this causes is that if we called it with
expected_task_state a concurrent modification to task_state will cause
us to fail and retry. However, expected_task_state will have been popped
from values on the first invocation and will not be present for the
second. Consequently the second invocation will fail to perform the
task_state check and therefore succeed, resulting in a race.

We rewrite the old race unit test which wasn't testing the correct
thing for 2 reasons:

1. Due to the bug fixed in this patch, although we were calling
   update_on_match() twice, the second call didn't check the task state.
2. side_effect=iterable returns function items without executing them,
   but we weren't hitting this due to the bug fixed in this patch.

Closes-Bug: #1821373
Change-Id: I01c63e685113bf30e687ccb14a4d18e344b306f6
2019-05-15 10:54:56 +01:00
..
api Microversion 2.73: Support adding the reason behind a server lock 2019-05-11 21:48:27 +00:00
cells Remove 'instance_update_at_top', 'instance_destroy_at_top' 2019-05-02 08:32:05 -06:00
cmd Merge "Add --instance option to heal_allocations" 2019-05-09 19:22:50 +00:00
common
compute Merge "Microversion 2.73: Support adding the reason behind a server lock" 2019-05-12 02:05:18 +00:00
conductor Merge "Only call _fill_provider_mapping if claim succeeds" 2019-05-02 12:53:47 +00:00
conf Merge "Delete the placement code" 2019-05-04 09:16:41 +00:00
console Stop handling cells v1 for console authentication 2019-04-16 18:26:17 +01:00
consoleauth Stop handling cells v1 for console authentication 2019-04-16 18:26:17 +01:00
db Fix retry of instance_update_and_get_original 2019-05-15 10:54:56 +01:00
hacking Delete the placement code 2019-04-28 20:06:15 +00:00
image Share snapshot image membership with instance owner 2019-02-08 18:06:27 -05:00
ipv6
keymgr
locale Imported Translations from Zanata 2019-03-22 06:26:27 +00:00
network Merge "Remove macs kwarg from allocate_for_instance" 2019-05-10 02:37:19 +00:00
notifications Microversion 2.73: Support adding the reason behind a server lock 2019-05-11 21:48:27 +00:00
objects Remove 'instance_update_at_top', 'instance_destroy_at_top' 2019-05-02 08:32:05 -06:00
pci Add get_instance_pci_request_from_vif 2019-03-07 11:37:53 +02:00
policies Remove '/os-cells' REST APIs 2019-04-16 18:26:13 +01:00
privsep Add test coverage for nova.privsep.qemu. 2019-04-04 20:44:01 +00:00
scheduler Merge "Trivial: use default value in next() func" 2019-05-03 20:30:29 +00:00
servicegroup [Trivial fix]Remove unnecessary slash 2019-05-06 16:23:59 +08:00
tests Fix retry of instance_update_and_get_original 2019-05-15 10:54:56 +01:00
virt Merge "Add xenapi driver image type capabilities" 2019-05-12 03:06:23 +00:00
vnc Deprecate the nova-xvpvncproxy service 2018-10-15 10:03:13 +01:00
volume Merge "Use migration_status during volume migrating and retyping" 2019-05-07 09:07:22 +00:00
__init__.py Eventlet monkey patching should be as early as possible 2019-03-22 09:27:16 +00:00
availability_zones.py Always pass HostAPI to get_availability_zones 2019-04-26 15:30:48 -04:00
baserpc.py
block_device.py Add method to generate device names universally 2019-01-15 18:55:11 +00:00
cache_utils.py
config.py Delete the placement code 2019-04-28 20:06:15 +00:00
context.py Revert "Fix target_cell usage for scatter_gather_cells" 2019-05-08 02:46:50 +00:00
crypto.py
debugger.py
exception.py Merge "Added mount fstype based validation of Quobyte mounts" 2019-04-05 17:41:13 +00:00
exception_wrapper.py
filters.py
hooks.py
i18n.py
loadables.py
manager.py
monkey_patch.py Bump to hacking 1.1.0 2019-04-12 16:23:49 +01:00
policy.py Fix string interpolations in logging calls 2019-01-29 15:06:39 +09:00
profiler.py
quota.py Merge "quota: remove defaults kwarg in get_project_quotas" 2019-02-26 13:26:24 +00:00
rpc.py test_rpc: Stop f****** with global state 2019-04-26 12:21:16 +01:00
safe_utils.py
service.py Remove 'nova-cells' service 2019-04-09 17:15:37 +01:00
service_auth.py
test.py Merge "Make nova.compute.rpcapi.ComputeAPI.router a singleton" 2019-04-28 20:22:52 +00:00
utils.py Eventlet monkey patching should be as early as possible 2019-03-22 09:27:16 +00:00
version.py
weights.py Per aggregate scheduling weight 2019-01-21 11:48:44 +08:00
wsgi.py