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 completed guest inventory after a caller deadline
pulse-triage[bot]942350d42a8c
diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.mdindex 68618092f9..4bbc080672 100644--- a/docs/release-control/v6/internal/subsystems/monitoring.md+++ b/docs/release-control/v6/internal/subsystems/monitoring.md@@ -7296,8 +7296,10 @@ replacement's guest readings. An interrupted inventory does not grant fallback.One cycle per live binding owns collection until it completes, including whenits caller is cancelled. Another connection can still advance independently.-Deep-enrichment expiry is distinct from parent-cycle cancellation: a complete-authoritative inventory still publishes within the reserved parent tail. An+Deep-enrichment/caller-deadline expiry is distinct from explicit parent-cycle+cancellation: already collected authoritative inventory still publishes even+when local assembly outlasts the caller budget. No new read or fallback is+admitted after deadline expiry. Anaccepted collection retains existing failed-node/grace rules, empty-inventoryhandling and metric/source/age policy. Focused builder and collector entry pointsretain their existing immediate effects. No guest operation lock, consumed-readdiff --git a/internal/monitoring/guest_poll_publication.go b/internal/monitoring/guest_poll_publication.goindex 2d152453e4..7bb6713ec4 100644--- a/internal/monitoring/guest_poll_publication.go+++ b/internal/monitoring/guest_poll_publication.go@@ -2,6 +2,7 @@ package monitoringimport ("context"+ "errors""sync""github.com/rcourtman/pulse-go-rewrite/internal/models"@@ -10,7 +11,8 @@ import (// A guest cycle collects outside publication locks. Its effects are staged// until both guest kinds are ready and the registered connection still owns// this cycle. Child enrichment deadlines do not invalidate an authoritative-// inventory; cancellation of the parent cycle does.+// inventory. An expired caller budget also keeps completed inventory usable;+// explicit cancellation of the parent cycle does not.type pveGuestPoll struct {ctx context.Contextcancel context.CancelFunc@@ -87,7 +89,12 @@ func (m *Monitor) publishPVEGuests(ctx context.Context, instance string, vms []mm.pveGuestPublicationMu.RLock()defer m.pveGuestPublicationMu.RUnlock()m.mu.RLock()- current := owner.ctx.Err() == nil && m.pveGuestPolls[instance] == owner && m.pveClients[instance] == owner.client && (m.runtimeCtx == nil || m.runtimeCtx.Err() == nil)+ cycleErr := owner.ctx.Err()+ // A caller deadline bounds remote enrichment, not the lifetime of the+ // configured connection. Keep the existing authoritative-inventory tail+ // even if local assembly outlasts that budget. Explicit cancellation, an+ // ended runtime or a changed binding still withdraws the entire cycle.+ current := (cycleErr == nil || errors.Is(cycleErr, context.DeadlineExceeded)) && m.pveGuestPolls[instance] == owner && m.pveClients[instance] == owner.client && (m.runtimeCtx == nil || m.runtimeCtx.Err() == nil)m.mu.RUnlock()if !current {returndiff --git a/internal/monitoring/proxmox_large_cluster_poll_budget_test.go b/internal/monitoring/proxmox_large_cluster_poll_budget_test.goindex 93f5668ef9..018646b8e1 100644--- a/internal/monitoring/proxmox_large_cluster_poll_budget_test.go+++ b/internal/monitoring/proxmox_large_cluster_poll_budget_test.go@@ -105,9 +105,9 @@ func TestLargePVEClusterPublishesCompleteGenerationWhenEnrichmentBudgetExpires(tresources: largeClusterResources(),}monitor.replacePVEClient("large-cluster", client)- // Expire only deep enrichment. The parent still owns the authoritative- // inventory and its reserved publication tail, unlike explicit cancellation.- ctx, cancel := context.WithTimeout(context.Background(), pvePollTailReserve-time.Second)+ // Deadline exhaustion must not lose completed authoritative inventory.+ // It is distinct from explicit cancellation or a retired connection.+ ctx, cancel := context.WithTimeout(context.Background(), 40*time.Millisecond)defer cancel()started := time.Now()@@ -187,9 +187,7 @@ func TestLargePVEClusterCoreSuccessKeepsConnectionHealthy(t *testing.T) {monitor.config.PVEInstances[0].MonitorContainers = truemonitor.replacePVEClient("large-cluster", client)- // This models an already exhausted detail budget, not cancellation of the- // entire connection cycle. Leave its authoritative publication tail alive.- ctx, cancel := context.WithTimeout(context.Background(), pvePollTailReserve-time.Second)+ ctx, cancel := context.WithTimeout(context.Background(), 250*time.Millisecond)defer cancel()monitor.pollPVEInstance(ctx, "large-cluster", client)