Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Preserve full poll budget for large PVE clusters
[email protected]0c5944b8eb6d
diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.goindex 12b9e8fc34..dba5f29b1b 100644--- a/internal/monitoring/monitor.go+++ b/internal/monitoring/monitor.go@@ -2139,7 +2139,14 @@ func (m *Monitor) taskWorker(ctx context.Context, id int) {func derivePollTimeout(cfg *config.Config) time.Duration {timeout := defaultTaskTimeoutif cfg != nil && cfg.ConnectionTimeout > 0 {- timeout = cfg.ConnectionTimeout * 2+ // ConnectionTimeout is the budget for one provider request, while a+ // poll cycle may enumerate hundreds of guests across many cluster+ // nodes. A short per-request timeout must not shrink the whole-cycle+ // budget below the default; that cancelled otherwise healthy large+ // PVE generations at exactly 30 seconds (#1437).+ if requestScaledTimeout := cfg.ConnectionTimeout * 2; requestScaledTimeout > timeout {+ timeout = requestScaledTimeout+ }}if timeout < minTaskTimeout {timeout = minTaskTimeoutdiff --git a/internal/monitoring/monitor_timeout_test.go b/internal/monitoring/monitor_timeout_test.goindex 8433d8d48d..f7356d2c26 100644--- a/internal/monitoring/monitor_timeout_test.go+++ b/internal/monitoring/monitor_timeout_test.go@@ -26,11 +26,18 @@ func TestDerivePollTimeout(t *testing.T) {want: 90 * time.Second,},{- name: "enforces minimum",+ name: "short request timeout does not shrink whole poll cycle",cfg: &config.Config{ConnectionTimeout: 5 * time.Second,},- want: minTaskTimeout,+ want: defaultTaskTimeout,+ },+ {+ name: "reported seven node cluster keeps default cycle budget",+ cfg: &config.Config{+ ConnectionTimeout: 10 * time.Second,+ },+ want: defaultTaskTimeout,},{name: "enforces maximum",