Merge "Fixed error on attempt to delete job execution several times"
This commit is contained in:
commit
a8a28ebbfe
@ -165,6 +165,11 @@ def cancel_job(job_execution_id):
|
||||
context.sleep(3)
|
||||
job_execution = conductor.job_execution_get(
|
||||
ctx, job_execution_id)
|
||||
if not job_execution:
|
||||
LOG.info(_LI("Job execution %(job_exec_id)s was deleted. "
|
||||
"Canceling current operation."),
|
||||
{'job_exec_id': job_execution_id})
|
||||
return job_execution
|
||||
else:
|
||||
LOG.info(_LI("Job execution status %(job)s: %(status)s"),
|
||||
{'job': job_execution.id,
|
||||
|
@ -300,7 +300,10 @@ def _cancel_job_execution(job_execution_id):
|
||||
|
||||
def _delete_job_execution(job_execution_id):
|
||||
try:
|
||||
_cancel_job_execution(job_execution_id)
|
||||
job_execution = job_manager.cancel_job(job_execution_id)
|
||||
if not job_execution:
|
||||
# job_execution was deleted already, nothing to do
|
||||
return
|
||||
except exceptions.CancelingFailed:
|
||||
LOG.error(_LE("Job execution %s can't be cancelled in time. "
|
||||
"Deleting it anyway."), job_execution_id)
|
||||
|
Loading…
Reference in New Issue
Block a user