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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user