From 4e05285567c403223e59697f9e611f48c0c2fce3 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sat, 29 Nov 2025 19:04:11 +0000 Subject: [PATCH] Fix cluster degraded status not recovering after transient failures The previous fix (6db4ee7a) cleared stale error messages but didn't mark endpoints as healthy again after successful operations. This caused clusters to remain in "degraded" state permanently once any endpoint had a temporary issue, even if all endpoints were actually working. The fix now marks endpoints healthy in clearEndpointError() after successful operations, ensuring degraded clusters recover automatically. Related to #659 --- pkg/proxmox/cluster_client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/proxmox/cluster_client.go b/pkg/proxmox/cluster_client.go index 8fb8cd3..198806a 100644 --- a/pkg/proxmox/cluster_client.go +++ b/pkg/proxmox/cluster_client.go @@ -401,10 +401,14 @@ func (cc *ClusterClient) markUnhealthyWithError(endpoint string, errMsg string) } // clearEndpointError removes any cached error for an endpoint after successful operations +// and marks the endpoint as healthy since the operation succeeded func (cc *ClusterClient) clearEndpointError(endpoint string) { cc.mu.Lock() defer cc.mu.Unlock() delete(cc.lastError, endpoint) + // Mark endpoint healthy since operation succeeded - this ensures degraded + // clusters recover once endpoints start responding again + cc.nodeHealth[endpoint] = true } // recoverUnhealthyNodes attempts to recover unhealthy nodes