Fix method lock release upon exception
Method lock was not released if method execution was ended with uncaught exception. As a result dead lock could occur. This commit moves lock release code into finally block Change-Id: Ie5794c55c9d5a30cd3255ac06e9af944eb732bb1 Closes-Bug: #1392102
This commit is contained in:
parent
b5bab3ef4b
commit
5cc0280490
|
@ -145,14 +145,23 @@ class MuranoDslExecutor(object):
|
|||
'{0}: Begin execution: {1}'.format(
|
||||
thread_marker, method_info))
|
||||
|
||||
gt = eventlet.spawn(self._invoke_method_implementation_gt, body,
|
||||
this, params, murano_class, context,
|
||||
thread_marker)
|
||||
result = gt.wait()
|
||||
del self._locks[(method_id, this_id)]
|
||||
LOG.debug(
|
||||
"{0}: End execution: {1}".format(thread_marker, method_info))
|
||||
event.send()
|
||||
try:
|
||||
gt = eventlet.spawn(self._invoke_method_implementation_gt, body,
|
||||
this, params, murano_class, context,
|
||||
thread_marker)
|
||||
result = gt.wait()
|
||||
except Exception as e:
|
||||
LOG.debug(
|
||||
"{0}: End execution: {1} with exception {2}".format(
|
||||
thread_marker, method_info, e))
|
||||
raise
|
||||
else:
|
||||
LOG.debug(
|
||||
"{0}: End execution: {1}".format(thread_marker, method_info))
|
||||
finally:
|
||||
del self._locks[(method_id, this_id)]
|
||||
event.send()
|
||||
|
||||
return result
|
||||
|
||||
def _invoke_method_implementation_gt(self, body, this,
|
||||
|
|
Loading…
Reference in New Issue