From 25062cf13008f233710920a124d9701871de10f8 Mon Sep 17 00:00:00 2001 From: m3taversal Date: Wed, 15 Apr 2026 16:26:03 +0100 Subject: [PATCH] Fix health check: accept HTTP 503 (stalled) as healthy Pipeline /health returns 503 when idle/stalled, which is a valid running state. Also increase post-restart wait from 15s to 30s for pipeline HTTP server initialization. Co-Authored-By: Claude Opus 4.6 (1M context) --- deploy/auto-deploy.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/deploy/auto-deploy.sh b/deploy/auto-deploy.sh index a392eff..9b07c60 100755 --- a/deploy/auto-deploy.sh +++ b/deploy/auto-deploy.sh @@ -96,7 +96,7 @@ fi if [ -n "$RESTART" ]; then log "Restarting:$RESTART" sudo systemctl restart $RESTART - sleep 15 + sleep 30 FAIL=0 for svc in $RESTART; do @@ -110,10 +110,11 @@ if [ -n "$RESTART" ]; then done if echo "$RESTART" | grep -q "teleo-pipeline"; then - if curl -sf --connect-timeout 3 http://localhost:8080/health > /dev/null 2>&1; then - log "pipeline health: OK" + HEALTH_CODE=$(curl -s -o /dev/null -w '%{http_code}' --connect-timeout 3 http://localhost:8080/health 2>/dev/null || echo "000") + if [ "$HEALTH_CODE" = "200" ] || [ "$HEALTH_CODE" = "503" ]; then + log "pipeline health: OK (HTTP $HEALTH_CODE)" else - log "WARNING: pipeline health check failed" + log "WARNING: pipeline health check failed (HTTP $HEALTH_CODE)" FAIL=1 fi fi