Skip to content

Commit

Permalink
Fix nonblocking related tracebacks, add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding committed Feb 9, 2023
1 parent feae0c8 commit 10567b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion awx/main/tasks/receptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,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:
Expand All @@ -441,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
Expand Down

0 comments on commit 10567b3

Please sign in to comment.