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.
This commit is contained in:
parent
545634372e
commit
dc94f6092a
1 changed files with 10 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue