From e919b723bc6f6604d3165d143de51715fbf057e7 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Fri, 17 Nov 2017 14:14:32 -0500 Subject: Retry on DB deadlock when updating resource Updating a row in the DB using UPDATE...WHERE... seems to be prone to deadlocks. We already fixed added retries for updates of the Stack table (bug 1578615); do the same with the Resource table. Change-Id: I3928f1acc3c354711a27523215784a8cf8767581 Closes-Bug: #1732969 --- heat/db/sqlalchemy/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/heat/db/sqlalchemy/api.py b/heat/db/sqlalchemy/api.py index dfdbcde00..caa409401 100644 --- a/heat/db/sqlalchemy/api.py +++ b/heat/db/sqlalchemy/api.py @@ -254,6 +254,8 @@ def _add_atomic_key_to_values(values, atomic_key): values['atomic_key'] = atomic_key + 1 +@oslo_db_api.wrap_db_retry(max_retries=3, retry_on_deadlock=True, + retry_interval=0.5, inc_retry_interval=True) def resource_update(context, resource_id, values, atomic_key, expected_engine_id=None): session = context.session -- cgit v1.2.1