Skip to content

Commit 431ffb8

Browse files
committed
fix(ci): cap azd provision attempts with hard timeout
1 parent e4ac8f3 commit 431ffb8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/azd-deploy.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ jobs:
580580
azd env set RS_KEY "$RS_KEY"
581581
582582
max_attempts=3
583+
max_attempt_minutes=20
583584
attempt=1
584585
previous_transient_signature=""
585586
@@ -597,7 +598,7 @@ jobs:
597598
598599
set +e
599600
provision_log="azd-provision-attempt-${attempt}.log"
600-
azd provision --no-prompt 2>&1 | tee "$provision_log"
601+
timeout --signal=TERM --kill-after=2m "${max_attempt_minutes}m" azd provision --no-prompt 2>&1 | tee "$provision_log"
601602
provision_exit=${PIPESTATUS[0]}
602603
set -e
603604
@@ -611,6 +612,12 @@ jobs:
611612
exit 1
612613
fi
613614
615+
if [ "$provision_exit" -eq 124 ]; then
616+
echo "Provision stopped: attempt exceeded ${max_attempt_minutes}m timeout."
617+
echo "Failing fast to avoid long-running hangs."
618+
exit 1
619+
fi
620+
614621
# Only retry on known transient Azure control-plane conflicts
615622
if ! grep -Eq 'RequestConflict|ContainerAppOperationInProgress|Operation expired|LeaseIdMissing' "$provision_log"; then
616623
echo "Provision failed with non-transient error; not retrying."

0 commit comments

Comments
 (0)