From a50a401deef9e8b8963e8d2547306cbf26e3312a Mon Sep 17 00:00:00 2001 From: Hao Liu Date: Mon, 27 Feb 2023 16:20:11 -0500 Subject: [PATCH] differentiate timeout vs idle timeout 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 --- ansible_runner/runner.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible_runner/runner.py b/ansible_runner/runner.py index 737d557fd..7997ec340 100644 --- a/ansible_runner/runner.py +++ b/ansible_runner/runner.py @@ -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() @@ -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')