diff --git a/mint-runner-token.sh b/mint-runner-token.sh index b176f6c..e85f49c 100755 --- a/mint-runner-token.sh +++ b/mint-runner-token.sh @@ -56,6 +56,53 @@ esac NOW=$(date +%s) EXP=$((NOW + 540)) # 9 min; GitHub max is 10 +# POST to a GitHub API endpoint, tolerating transient failures. +# +# Why this exists: GitHub's API returns routine, short-lived 5xx/429s, and a +# single one used to be fatal. The old `curl -fsS ... | jq` piped an empty body +# into jq on any HTTP error, so the registrar died with an opaque `jq` exit 4; +# the runner then never started and systemd's StartLimitBurst parked the whole +# unit until a human intervened. A momentary blip became a multi-hour outage. +# +# So: retry on network errors and HTTP 429/5xx with backoff, fail fast on a +# genuine 4xx (bad creds / permissions — retrying won't help), and log the real +# HTTP status either way. Retry budget (~21s of sleeps) stays well under the +# registrar healthcheck's ~90s window so a slow mint can't be marked unhealthy. +# +# Args: