From ed2742dc55ef3e246d67f632c1b3514da5bd8d39 Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Mon, 17 Nov 2025 10:50:28 +0100 Subject: [PATCH] [os_must_gather] Increase must gather timeout; print error on timeout It seems that 'oc adm must-gather' command in some CI jobs does not finish on time. This commit increase the timeout from default 12 minutes (cifmw_os_must_gather_timeout - 10 minutes + 120s) to 25 minutes. Also print message when timeout has killed the command. Signed-off-by: Daniel Pawlik --- roles/os_must_gather/tasks/main.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/roles/os_must_gather/tasks/main.yml b/roles/os_must_gather/tasks/main.yml index a409961162..7b578d5fab 100644 --- a/roles/os_must_gather/tasks/main.yml +++ b/roles/os_must_gather/tasks/main.yml @@ -56,6 +56,8 @@ - _kubeconfig_stat.stat.exists block: - name: Run openstack-must-gather command + vars: + shell_cmd_timeout: "{{ (cifmw_os_must_gather_timeout | community.general.to_seconds) + 900 }}" environment: KUBECONFIG: "{{ cifmw_openshift_kubeconfig | default(cifmw_os_must_gather_kubeconfig) }}" PATH: "{{ cifmw_path }}" @@ -65,7 +67,7 @@ cifmw.general.ci_script: output_dir: "{{ cifmw_os_must_gather_output_dir }}/artifacts" script: >- - timeout {{ (cifmw_os_must_gather_timeout | community.general.to_seconds) + 120 }} + timeout {{ shell_cmd_timeout }} oc adm must-gather --image {{ cifmw_os_must_gather_image }} --timeout {{ cifmw_os_must_gather_timeout }} --host-network={{ cifmw_os_must_gather_host_network }} @@ -75,7 +77,13 @@ SOS_EDPM=$SOS_EDPM SOS_DECOMPRESS=$SOS_DECOMPRESS gather - 2>&1 + 2>&1 || { + rc=$? + if [ $rc -eq 124 ]; then + echo "The must gather command did not finish on time!" + echo "{{ shell_cmd_timeout }} seconds was not enough to finish the task." + fi + } - name: Find existing os-must-gather directories ansible.builtin.find: