Add a retry_on_deadlock to reservations_expire

Now that we have an index for the reservations_expire query, we
have uncovered a race with quota usage updates due to the foreign
key on the table, so just retry if there is a deadlock. This is
a fix to unblock the gate while we try to remove the deadlocks
completely.

Change-Id: I1993c3bd1f81facf1d98a4e29f9e8df4858a7d66
Partial-bug: #1350466
(cherry picked from commit 3619c1914e)
This commit is contained in:
Vishvananda Ishaya 2014-07-31 14:00:54 -07:00
parent b53adea2d0
commit d8b9ba5ef7
1 changed files with 1 additions and 0 deletions

View File

@ -3349,6 +3349,7 @@ def quota_destroy_all_by_project(context, project_id):
@require_admin_context
@_retry_on_deadlock
def reservation_expire(context):
session = get_session()
with session.begin():