From d6bc5ce85c00482cb9e0e31feaa588a92922528b Mon Sep 17 00:00:00 2001 From: IK Date: Fri, 11 Sep 2026 07:44:30 +0700 Subject: [PATCH] fix: alert on degraded community scheduler health --- deploy/monitor.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/deploy/monitor.sh b/deploy/monitor.sh index 96175e9..7628fbe 100755 --- a/deploy/monitor.sh +++ b/deploy/monitor.sh @@ -45,6 +45,18 @@ done ready_payload=$(curl -fsS --max-time 10 "$base_url/ready" 2>/dev/null) || ready_payload="" printf '%s' "$ready_payload" | grep -Eq '"status"[[:space:]]*:[[:space:]]*"ready"' || fail "readiness" +# Import health is intentionally non-blocking for /ready, but must still alert. +# Parse the nested component instead of accepting any unrelated "ready" field. +community_status=$(printf '%s' "$ready_payload" | python3 -c 'import json,sys +try: + payload=json.load(sys.stdin) + print(payload.get("components",{}).get("community_scheduler",{}).get("status", "unknown")) +except Exception: + print("unknown")') +case "$community_status" in + ready) : ;; + *) fail "community-scheduler:${community_status}" ;; +esac disk_used=$(df -Pk "$repo" | awk 'NR==2 {gsub(/%/, "", $5); print $5}') case "$disk_used" in