monitoring: cross-probe dead-man email must retry after a failed send #609
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra#609
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
What
The services host probes the monitoring VM (
bitborg-monitoring-probe.sh.j2) and emails when it is down.send_mailreturns 0 when SMTP is unset (:31) and swallows a curl failure with|| echo "[probe] mail send failed"(:48). The callers write the state file right after the call (:77,:88,:101,:114).Related to #389, which is about detecting provider-side failures. This is a separate defect in the probe.
Why
This email is the only signal when the monitoring VM is dead, because Alertmanager and ntfy live on that VM.
Failing case
The monitoring VM goes down while the SMTP relay is also failing, or the mailer credential was rotated.
send_mailfails. The script writesdownto the state file. The next run seesprev=downand never retries. The recovery email is lost the same way.Fix
Make
send_mailreturn curl's exit status, and return non-zero when SMTP is unset. Write the state only on success at all four call sites, for examplesend_mail ... && echo down > "$STATE_FILE".Done when
curlto fail and shows no state change.