From bd283d629d5c5c7ef90635439245929913a611bf Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Mon, 16 Nov 2026 17:17:56 +0100 Subject: [PATCH] Deploy: health check wacht tot ongeveer 2 minuten (40 pogingen van 3 s, 5 s per verzoek) Een opstart duurt normaal 10 s maar was 22 tot 29 s toen twee services kort na elkaar herstartten op een drukke Pi; 10 pogingen waren dan te weinig. Co-Authored-By: Claude Sonnet 5.5 --- .gitea/workflows/deploy-scp.yaml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/deploy-scp.yaml b/.gitea/workflows/deploy-scp.yaml index 2db2680..7bb47a1 100644 --- a/.gitea/workflows/deploy-scp.yaml +++ b/.gitea/workflows/deploy-scp.yaml @@ -228,20 +228,24 @@ jobs: systemctl --user restart ${{ inputs.service_name }}" # Verifies the restart actually produced a healthy process before this run is allowed to - # report success. Retries absorb ordinary process-startup time; a run that never turns healthy - # fails the job without touching `current` or pruning (see below) — no automatic rollback. - # A previous release is always still on disk to restore from manually (D-26). + # report success. Retries absorb process-startup time, which is about 10 seconds normally but + # 30 seconds or more when the host is busy (a migration step, two services restarting at once + # on one machine): up to 40 attempts, 3 seconds apart (about 2 minutes), each request limited + # to 5 seconds so one hanging attempt cannot eat the whole window. A run that never turns + # healthy fails the job without touching `current` or pruning (see below) - no automatic + # rollback. A previous release is always still on disk to restore from manually (D-26). - name: Verify /health run: | - for attempt in $(seq 1 10); do - if curl -f -s -o /dev/null "${{ inputs.health_check_url }}"; then + attempts=40 + for attempt in $(seq 1 $attempts); do + if curl -f -s --max-time 5 -o /dev/null "${{ inputs.health_check_url }}"; then echo "Health check passed on attempt $attempt" exit 0 fi - echo "Health check attempt $attempt failed, retrying..." + echo "Health check attempt $attempt of $attempts failed, retrying..." sleep 3 done - echo "Health check did not pass after 10 attempts" + echo "Health check did not pass after $attempts attempts" exit 1 # Retention: keep `current` plus exactly one previous release, so a manual rollback is always