mirror of
https://github.com/ansible/awx.git
synced 2026-02-02 01:58:09 -03:30
Avoid resultsock shutdown before reading from it
This commit is contained in:
@@ -3169,10 +3169,6 @@ class AWXReceptorJob:
|
||||
self.task.update_model(self.task.instance.pk, status='pending')
|
||||
return
|
||||
|
||||
# if we did not exceed the quota, continue with shutting down the job
|
||||
resultsock.shutdown(socket.SHUT_RDWR)
|
||||
resultfile.close()
|
||||
|
||||
# If ansible-runner ran, but an error occured at runtime, the traceback information
|
||||
# is saved via the status_handler passed in to the processor.
|
||||
if state_name == 'Succeeded':
|
||||
@@ -3185,8 +3181,13 @@ class AWXReceptorJob:
|
||||
self.task.instance.result_traceback = b"".join(lines).decode()
|
||||
self.task.instance.save(update_fields=['result_traceback'])
|
||||
except Exception:
|
||||
resultsock.shutdown(socket.SHUT_RDWR)
|
||||
resultfile.close()
|
||||
raise RuntimeError(detail)
|
||||
|
||||
resultsock.shutdown(socket.SHUT_RDWR)
|
||||
resultfile.close()
|
||||
|
||||
time.sleep(3)
|
||||
return res
|
||||
|
||||
|
||||
Reference in New Issue
Block a user