diff --git a/nova/objects/resource_provider.py b/nova/objects/resource_provider.py index 32b4359399a..300bc89ddb5 100644 --- a/nova/objects/resource_provider.py +++ b/nova/objects/resource_provider.py @@ -18,6 +18,7 @@ import os_traits from oslo_concurrency import lockutils +from oslo_db import api as oslo_db_api from oslo_db import exception as db_exc from oslo_log import log as logging from oslo_utils import versionutils @@ -1791,6 +1792,7 @@ def _ensure_consumer_project_user(self, conn, consumer_id): # if the consumer already exists. pass + @oslo_db_api.wrap_db_retry(max_retries=5, retry_on_deadlock=True) @db_api.api_context_manager.writer def _set_allocations(self, context, allocs): """Write a set of allocations.