From 539eadfab20badf7cb763bf4b130e21b7e5b1616 Mon Sep 17 00:00:00 2001 From: rcourtman <8825017+rcourtman@users.noreply.github.com> Date: Wed, 7 Oct 2026 17:36:34 +0100 Subject: [PATCH] Judge filesystem alerts by their own threshold on config save A config save re-judges every active alert. Agent filesystem alerts were re-judged by the host disk threshold, ignoring the filesystem's own override and the per-type DiskFillByType threshold CheckHost uses. Guest filesystem alerts were resolved by their "-disk-" resource ID, which matches no guest-disk override and names no guest, so the guest's own override was missed too. A filesystem override of 70 raised an alert at 80 under a default of 90; saving any alert setting resolved it and sent a recovery, and the next poll raised it again as a new alert. CheckHost and CheckGuest now resolve a filesystem's threshold through hostDiskUsageThresholdNoLock and guestDiskUsageThresholdNoLock, and reevaluation calls the same helpers: resolveHostAlertThresholdsNoLock for agent filesystem alerts, and a new resolveGuestAlertThresholdsNoLock that resolves a guest filesystem alert's guest by the ID parseGuestAlertIdentity reads from its resource ID. The helpers return override and per-type thresholds as owned copies, so evaluation still never normalizes the live config. TestConfigSaveJudgesFilesystemAlertsByTheirOwnThreshold covers an agent filesystem override, an NVMe fill threshold, a guest filesystem override and a guest override. With host.go, guest.go and config_runtime.go overlaid by their origin/main or #2696 copies, all four fail: the unchanged save resolves the alert. Stacked on #2696. --- .../v6/internal/subsystems/alerts.md | 28 +++++ internal/alerts/config_runtime.go | 2 +- internal/alerts/guest.go | 56 +++++++-- internal/alerts/host.go | 78 +++++++----- .../threshold_resolution_shared_test.go | 117 ++++++++++++++++++ 5 files changed, 234 insertions(+), 47 deletions(-) diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md index 6e4f87d46f..e55ec55063 100644 --- a/docs/release-control/v6/internal/subsystems/alerts.md +++ b/docs/release-control/v6/internal/subsystems/alerts.md @@ -3163,6 +3163,34 @@ in place, is gone. `internal/alerts/alerts_test.go` evaluation against `GetConfig()` and `UpdateConfig(GetConfig())` under `-race`. +### Config-save reevaluation judges a filesystem alert by its own threshold + +`UpdateConfig` re-judges every active alert, and a filesystem usage alert's +threshold resolves through the same per-filesystem helper its evaluator uses. +`hostDiskUsageThresholdNoLock` resolves an agent filesystem +(`agent:/disk: