Retrigger new traversals after resource cancellation

If we force-cancel a resource check operation (i.e. by killing the thread)
then there was a short window where another traversal could have started
and been waiting on the not-yet-cancelled resource. That traversal would
then hang forever, as there was nothing to retrigger it. This change
ensures we retrigger the latest traversal on the resource after
cancellation.

Change-Id: Iae27c9cc5c0895b52aef2f2c72686dc48ec5983c
Closes-Bug: #1727007
This commit is contained in:
Zane Bitter 2017-10-30 18:51:59 -04:00 committed by rabi
parent c9792b96d2
commit 4a30b2ff56
1 changed files with 5 additions and 2 deletions

View File

@ -177,8 +177,11 @@ class CheckResource(object):
except scheduler.Timeout:
self._handle_resource_failure(cnxt, is_update, rsrc.id,
stack, u'Timed out')
except CancelOperation:
pass
except CancelOperation as ex:
# Stack is already marked FAILED, so we just need to retrigger
# in case a new traversal has started and is waiting on us.
self._retrigger_new_traversal(cnxt, current_traversal, is_update,
stack.id, rsrc.id)
return False