Don't attempt to update tmpl ID when resource in progress

If we attempt to do a convergence update on a resource and find it already
locked by another traversal, don't try to update the resource's current
template ID or requirements data. Doing so will usually fail with the same
exception, but it is unnecessary and leaves ERROR-level messages in the
log. However, there is a race which could result in the call succeeding
(i.e. if the other task releases the lock just after we fail to get it),
and that could result in the resource not being updated at all.

Change-Id: I6bde1f9359cd52c99cca092e8abc660bac8b3065
Closes-Bug: #1722371
This commit is contained in:
Zane Bitter 2017-10-18 16:46:39 -04:00
parent bb330ae1a6
commit 79cc0cc7b9
1 changed files with 2 additions and 0 deletions

View File

@ -1384,6 +1384,8 @@ class Resource(status.ResourceStatus):
runner(timeout=timeout, progress_callback=progress_callback) runner(timeout=timeout, progress_callback=progress_callback)
except UpdateReplace: except UpdateReplace:
raise raise
except exception.UpdateInProgress:
raise
except BaseException: except BaseException:
with excutils.save_and_reraise_exception(): with excutils.save_and_reraise_exception():
update_templ_id_and_requires(persist=True) update_templ_id_and_requires(persist=True)