fix: don't purge connectivity/rtt alerts in purge_stale_alerts

These entries are set by the connection state machine, not by threshold
config, so they have no threshold entry and were being deleted on every
startup. Guard them explicitly so overdue/down alerts survive the purge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Andreas Wrede
2026-06-06 14:45:47 -04:00
parent 3a0c48e32b
commit 3da6976b53
+4
View File
@@ -1554,6 +1554,10 @@ class ThresholdChecker:
configured = self.get_thresholds_for_host(hostname) configured = self.get_thresholds_for_host(hostname)
stale = [] stale = []
for mp in host.alert_states: for mp in host.alert_states:
# connectivity.* and rtt are managed by the connection state
# machine, not by threshold config — never purge them.
if mp == "rtt" or mp.startswith("connectivity."):
continue
if self._find_threshold(configured, mp)[0] is not None: if self._find_threshold(configured, mp)[0] is not None:
continue continue
# Also match wildcard pool/partition thresholds (e.g. "zfs_monitor.*.status" # Also match wildcard pool/partition thresholds (e.g. "zfs_monitor.*.status"