mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
when releasing receptor work, do so in try/except
This commit is contained in:
@@ -3063,7 +3063,13 @@ class AWXReceptorJob:
|
|||||||
finally:
|
finally:
|
||||||
# Make sure to always release the work unit if we established it
|
# Make sure to always release the work unit if we established it
|
||||||
if self.unit_id is not None and settings.RECEPTOR_RELEASE_WORK:
|
if self.unit_id is not None and settings.RECEPTOR_RELEASE_WORK:
|
||||||
receptor_ctl.simple_command(f"work release {self.unit_id}")
|
try:
|
||||||
|
receptor_ctl.simple_command(f"work release {self.unit_id}")
|
||||||
|
except RuntimeError:
|
||||||
|
logger.exception(f"Unable to release work item {self.unit_id}")
|
||||||
|
# If an error occured without the job itself failing, it could be a broken instance
|
||||||
|
if self.work_type == 'ansible-runner' and ((res is None) or (getattr(res, 'rc', None) is None)):
|
||||||
|
execution_node_health_check.delay(self.task.instance.execution_node)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def sign_work(self):
|
def sign_work(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user