From 2d9a10e85c6d00d08ae98c2df7327f5881d36fa3 Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Tue, 4 Aug 2026 20:26:20 +0200 Subject: [PATCH] feat(workflows): implement timeout for pacman installation This update introduces a timeout mechanism for the pacman installation process in the app builder workflow. If the installation does not complete within 30 minutes, it will terminate and log a timeout message, improving the robustness of the build process. - Adds a timeout for the pacman command to prevent indefinite hangs - Implements a heartbeat to monitor the installation progress - Provides clear error messages for timeout and failure scenarios --- .gitea/workflows/app_builder.yaml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/app_builder.yaml b/.gitea/workflows/app_builder.yaml index 0de9c0e..cf2b9b5 100644 --- a/.gitea/workflows/app_builder.yaml +++ b/.gitea/workflows/app_builder.yaml @@ -160,10 +160,34 @@ jobs: for ARCH_INSTALL_ATTEMPT in 1 2 3; do echo "pacman attempt $ARCH_INSTALL_ATTEMPT of 3" - if pacman -Syu --needed --noconfirm "${ARCH_PACKAGES[@]}"; then + timeout --signal=TERM 30m \ + pacman -Syu --needed --noconfirm --noprogressbar \ + "${ARCH_PACKAGES[@]}" \ + /dev/null || true + wait "$ARCH_HEARTBEAT_PID" 2>/dev/null || true + + if [ "$ARCH_PACMAN_STATUS" -eq 0 ]; then break fi + if [ "$ARCH_PACMAN_STATUS" -eq 124 ]; then + echo "pacman attempt timed out after 30 minutes" >&2 + fi + if [ "$ARCH_INSTALL_ATTEMPT" -eq 3 ]; then echo "pacman failed after 3 attempts" >&2 exit 1