Add @_retry_on_deadlock to _instance_update()

This patch adds the @_retry_on_deadlock decorator
to _instance_update(), which has been observed to be
involved in some deadlock scenarios.  As it is the point
of transaction demarcation based on the presence of
get_session(), this is an appropriate point at which the
transaction can be re-attempted in the case of deadlock.

Change-Id: Id2cfdc129ea3cfc787b73f1f3e9aa286a7c0229a
Closes-bug: 1375467
Cherry-picked from: 68ed3c034b
This commit is contained in:
Mike Bayer 2014-09-29 17:00:20 -04:00
parent 3136cfc11f
commit 837411ad3f
1 changed files with 1 additions and 0 deletions

View File

@ -2314,6 +2314,7 @@ def _instance_metadata_update_in_place(context, instance, metadata_type, model,
instance[metadata_type].append(newitem)
@_retry_on_deadlock
def _instance_update(context, instance_uuid, values, copy_old_instance=False,
columns_to_join=None):
session = get_session()