diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-03-14 00:56:04 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-03-14 00:56:04 +0000 |
commit | 9bbd868d83abb32f2e56f6f26d367d80969767f7 (patch) | |
tree | 43929e9494695f40e13395373f26734025c3f392 | |
parent | 5661055b8b138aa027b4e3f3d3d7f8a2ec928adf (diff) | |
parent | 656452548b2d8d654a25fc27476cd77a9b8a9172 (diff) | |
download | nova-9bbd868d83abb32f2e56f6f26d367d80969767f7.tar.gz |
Merge "Enable compute_node_update to tolerate deadlocks" into stable/havana
-rw-r--r-- | nova/db/sqlalchemy/api.py | 1 | ||||
-rw-r--r-- | nova/tests/db/test_db_api.py | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 04a77bb46a..1a2c07dd7e 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -658,6 +658,7 @@ def _update_stats(context, new_stats, compute_id, session, prune_stats=False): @require_admin_context +@_retry_on_deadlock def compute_node_update(context, compute_id, values, prune_stats=False): """Updates the ComputeNode record with the most recent data.""" stats = values.pop('stats', {}) diff --git a/nova/tests/db/test_db_api.py b/nova/tests/db/test_db_api.py index a9a34542d6..e6c4a80bdf 100644 --- a/nova/tests/db/test_db_api.py +++ b/nova/tests/db/test_db_api.py @@ -156,6 +156,9 @@ class DecoratorTestCase(test.TestCase): def test_require_admin_context_decorator_wraps_functions_properly(self): self._test_decorator_wraps_helper(sqlalchemy_api.require_admin_context) + def test_require_deadlock_retry_wraps_functions_properly(self): + self._test_decorator_wraps_helper(sqlalchemy_api._retry_on_deadlock) + def _get_fake_aggr_values(): return {'name': 'fake_aggregate'} |