From 5f27f777fb7dbcefb0bd9dc9965731056d5b7b39 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Thu, 9 Feb 2023 13:42:26 -0500 Subject: [PATCH] Fix nonblocking related tracebacks, add logging --- awx/main/tasks/receptor.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/awx/main/tasks/receptor.py b/awx/main/tasks/receptor.py index 24d9134f3901..6f2dd944d222 100644 --- a/awx/main/tasks/receptor.py +++ b/awx/main/tasks/receptor.py @@ -186,7 +186,6 @@ def run_until_complete(node, timing_data=None, **kwargs): stdout = '' try: - resultfile = receptor_ctl.get_work_results(unit_id) while run_timing < 20.0: @@ -206,7 +205,6 @@ def run_until_complete(node, timing_data=None, **kwargs): stdout = str(stdout, encoding='utf-8') finally: - if settings.RECEPTOR_RELEASE_WORK: res = receptor_ctl.simple_command(f"work release {unit_id}") if res != {'released': unit_id}: @@ -433,7 +431,6 @@ def _run_internal(self, receptor_ctl): # massive, only ask for last 1000 bytes startpos = max(stdout_size - 1000, 0) resultsock, resultfile = receptor_ctl.get_work_results(self.unit_id, startpos=startpos, return_socket=True, return_sockfile=True) - resultsock.setblocking(False) # this makes resultfile reads non blocking lines = resultfile.readlines() receptor_output = b"".join(lines).decode() if receptor_output: @@ -443,6 +440,7 @@ def _run_internal(self, receptor_ctl): else: logger.warning(f'No result details or output from {self.task.instance.log_format}, status:\n{state_name}') except Exception: + logger.exception(f'Work results error from job id={self.task.instance.id} work_unit={self.task.instance.work_unit_id}') raise RuntimeError(detail) return res