Skip to content

Commit

Permalink
differentiate timeout vs idle timeout
Browse files Browse the repository at this point in the history
currently idle timeout and timeout result in the same status call back this result in the AWX not being able to parse the differences between the two failure condition and make it confusing to debg

Co-Authored-By: Gabriel Muniz <[email protected]>
  • Loading branch information
TheRealHaoLiu and Gabriel Muniz committed Feb 27, 2023
1 parent a4a981d commit a50a401
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ansible_runner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def _decode(x):
if self.config.idle_timeout and (time.time() - self.last_stdout_update) > self.config.idle_timeout:
self.kill_container()
Runner.handle_termination(child.pid, is_cancel=False)
self.timed_out = True
self.idle_timed_out = True

stdout_handle.close()
stderr_handle.close()
Expand All @@ -350,6 +350,8 @@ def _decode(x):
self.status_callback('successful')
elif self.timed_out:
self.status_callback('timeout')
elif self.timed_out:
self.status_callback('idle_timeout')
else:
self.status_callback('failed')

Expand Down

0 comments on commit a50a401

Please sign in to comment.