From dc94f6092a0d68e3737c7c600a40948dd1dd6e2a Mon Sep 17 00:00:00 2001 From: rcourtman Date: Wed, 5 Nov 2025 19:49:17 +0000 Subject: [PATCH] Add retry logic for guest agent filesystem info in efficient polling Related to #630 When using the efficient polling path (cluster/resources endpoint), guest agent calls to GetVMFSInfo were made without retry logic. This could cause transient "Guest details unavailable" errors during initialization when the guest agent wasn't immediately ready to respond. The traditional polling path already used retryGuestAgentCall for filesystem info queries, providing resilience against transient timeouts. This commit applies the same retry logic to the efficient polling path for consistency. Changes: - Wrap GetVMFSInfo call in efficient polling with retryGuestAgentCall - Use configured guestAgentFSInfoTimeout and guestAgentRetries settings - Ensures consistent behavior between traditional and efficient polling paths This should resolve the transient initialization issue reported in #630 where guest details were unavailable until after a reinstall/restart. --- internal/monitoring/monitor.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.go index 60a2f87..21d7098 100644 --- a/internal/monitoring/monitor.go +++ b/internal/monitoring/monitor.go @@ -6131,7 +6131,16 @@ func (m *Monitor) pollVMsAndContainersEfficient(ctx context.Context, instanceNam Uint64("current_maxdisk", diskTotal). Msg("Guest agent enabled, querying filesystem info for accurate disk usage") - fsInfo, err := client.GetVMFSInfo(ctx, res.Node, res.VMID) + // Use retry logic for guest agent calls to handle transient timeouts (refs #630) + fsInfoRaw, err := m.retryGuestAgentCall(ctx, m.guestAgentFSInfoTimeout, m.guestAgentRetries, func(ctx context.Context) (interface{}, error) { + return client.GetVMFSInfo(ctx, res.Node, res.VMID) + }) + var fsInfo []proxmox.VMFileSystem + if err == nil { + if fs, ok := fsInfoRaw.([]proxmox.VMFileSystem); ok { + fsInfo = fs + } + } if err != nil { // Log more helpful error messages based on the error type errMsg := err.Error()