Clear an old pass on a wait, and say a change of waits (review of #78)
mesh/merge-gate pass: builds mesh-host → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery delivered

A resource that passed, then waited, then failed once after its grace was
still stated healthy from the old pass; and a change of what it waits for
alone raised no change event, so the controller could miss it.
This commit is contained in:
jochen
2026-10-10 21:14:14 +02:00
parent 3abb07f1e2
commit 9545121ec9
3 changed files with 112 additions and 8 deletions
+11 -1
View File
@@ -368,7 +368,8 @@ func (j *Judge) Look(ctx context.Context) (Statement, bool) {
seen[r.ID] = true
st.Resources = append(st.Resources, State{Resource: k.Resource, State: k.State, Reason: k.Reason, Since: k.Since,
Streak: k.Streak, Restarts: k.Counted, Waits: waitsOf(k)})
word := k.State + "/" + k.Reason
// What it waits for is part of what is said: a change of waits alone is a change.
word := k.State + "/" + k.Reason + "/" + waitsWord(waitsOf(k))
if j.said[r.ID] != word {
changed = true
j.said[r.ID] = word
@@ -579,3 +580,12 @@ func waitsOf(k *kept) []health.Wait {
}
return append([]health.Wait(nil), k.Waits...)
}
// waitsWord is a resource's waits in one comparable word.
func waitsWord(ws []health.Wait) string {
var b strings.Builder
for _, w := range ws {
b.WriteString(w.Part + "|" + w.Secret + "|" + w.Setting + "|" + w.What + ";")
}
return b.String()
}