From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 592D91FF0B4 for ; Fri, 27 Nov 2026 15:04:27 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id EA644216ED; Fri, 27 Nov 2026 15:04:26 +0100 (CET) From: Jakob Klocker To: pdm-devel@lists.proxmox.com Subject: [PATCH proxmox-datacenter-manager v2 2/2] fix #7731: metric collection: allow 5 minutes for PVE metric requests Date: Fri, 27 Nov 2026 15:03:58 +0100 Message-ID: <20261127140358.205440-3-j.klocker@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261127140358.205440-1-j.klocker@proxmox.com> References: <20261127140358.205440-1-j.klocker@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795788262320 X-SPAM-LEVEL: Spam detection results: 0 AWL 1.078 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: YBA3FO4YLIIDEFBULHUQCMC6B2JM4HOS X-Message-ID-Hash: YBA3FO4YLIIDEFBULHUQCMC6B2JM4HOS X-MailFrom: j.klocker@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Exporting the full metric history of a large PVE cluster can take minutes: on a 25-node cluster with about 2800 guests, the export took 2m43s. The client's request timeout of 60 seconds cut such requests off, and the request was repeated on every other endpoint of the remote until all of its nodes were marked unreachable, so no metrics were ever collected for such a cluster. Use a client with a 5 minute timeout for fetching the metrics of PVE remotes. All other requests keep the shorter timeout, so they still fail over quickly to the next endpoint when a node does not answer. Signed-off-by: Jakob Klocker --- server/src/metric_collection/remote_collection_task.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/metric_collection/remote_collection_task.rs b/server/src/metric_collection/remote_collection_task.rs index 1e0011cb..b5d102fa 100644 --- a/server/src/metric_collection/remote_collection_task.rs +++ b/server/src/metric_collection/remote_collection_task.rs @@ -36,6 +36,9 @@ const METRIC_COLLECTION_STATE_FILE: &str = concat!( pub const MAX_CONCURRENT_CONNECTIONS: usize = 20; +/// Timeout for fetching the metrics of a PVE remote. +const PVE_METRICS_REQUEST_TIMEOUT: Duration = Duration::from_secs(5 * 60); + /// Default metric collection interval. pub const DEFAULT_COLLECTION_INTERVAL: u64 = 600; /// Minimum metric collection interval. @@ -315,7 +318,9 @@ impl RemoteMetricCollectionTask { let res: Result = async { match remote.ty { RemoteType::Pve => { - let client = app.client_factory().make_pve_client(&remote)?; + let client = app + .client_factory() + .make_pve_client_with_timeout(&remote, PVE_METRICS_REQUEST_TIMEOUT)?; let metrics = client .cluster_metrics_export( Some(true), -- 2.47.3