From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 455F21FF09F for ; Tue, 01 Dec 2026 09:17:25 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 01BA1209AA; Tue, 01 Dec 2026 09:17:25 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 01 Dec 2026 09:17:20 +0100 Message-Id: Subject: Re: [PATCH proxmox-datacenter-manager v2 2/2] fix #7731: metric collection: allow 5 minutes for PVE metric requests From: "Jakob Klocker" To: "Thomas Lamprecht" , X-Mailer: aerc 0.20.0 References: <20261127140358.205440-1-j.klocker@proxmox.com> <20261127140358.205440-3-j.klocker@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1796113041045 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.097 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: JTYD6ETGWFKTYHPNPRCXS7DKKNNEQENE X-Message-ID-Hash: JTYD6ETGWFKTYHPNPRCXS7DKKNNEQENE 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: On Mon Nov 30, 2026 at 9:09 PM CET, Thomas Lamprecht wrote: > Am 27.11.26 um 15:04 schrieb Jakob Klocker: >> 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. >>=20 >> 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. >>=20 >> Signed-off-by: Jakob Klocker >> --- >> server/src/metric_collection/remote_collection_task.rs | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >>=20 >> diff --git a/server/src/metric_collection/remote_collection_task.rs b/se= rver/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 =3D concat!( >> =20 >> pub const MAX_CONCURRENT_CONNECTIONS: usize =3D 20; >> =20 >> +/// Timeout for fetching the metrics of a PVE remote. >> +const PVE_METRICS_REQUEST_TIMEOUT: Duration =3D Duration::from_secs(5 *= 60); >> + >> /// Default metric collection interval. >> pub const DEFAULT_COLLECTION_INTERVAL: u64 =3D 600; >> /// Minimum metric collection interval. >> @@ -315,7 +318,9 @@ impl RemoteMetricCollectionTask { >> let res: Result =3D async { >> match remote.ty { >> RemoteType::Pve =3D> { >> - let client =3D app.client_factory().make_pve_client= (&remote)?; >> + let client =3D app >> + .client_factory() >> + .make_pve_client_with_timeout(&remote, PVE_METR= ICS_REQUEST_TIMEOUT)?; >> let metrics =3D client >> .cluster_metrics_export( >> Some(true), > > > As per my reply to the [v1] this should not be required, but if I'd > also add a general timeout to avoid that retrying all other nodes on > a remote adds up to a huge total timeout (12 nodes one hour), i.e. > something like bellow the scissors. > > [v1]: https://lore.proxmox.com/pdm-devel/3278ee5b-95a3-4477-90de-e8633593= 40ef@proxmox.com/ > Thanks for the feedback! I'll drop this for now and come back to it if users still run into the timeout once the export endpoint fetches asynchronously. If it turns out to be necessary, I'll make sure to include your patch. I'll also make sure to test your async export series and report back there.