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 571DE1FF135 for ; Thu, 02 Jul 2026 11:23:49 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id DAF4821469; Thu, 02 Jul 2026 11:23:48 +0200 (CEST) From: Lukas Wagner To: pdm-devel@lists.proxmox.com Subject: [PATCH datacenter-manager 02/15] task cache: fix missing cutoff state for PBS remotes Date: Thu, 2 Jul 2026 11:22:45 +0200 Message-ID: <20260702092258.174740-3-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260702092258.174740-1-l.wagner@proxmox.com> References: <20260702092258.174740-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1782984189465 X-SPAM-LEVEL: Spam detection results: 0 DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) 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: DSTKF4GCKMJHBR7BVBU5U5I7JK2P2IRM X-Message-ID-Hash: DSTKF4GCKMJHBR7BVBU5U5I7JK2P2IRM X-MailFrom: l.wagner@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: The node success map, which is used to determine whether the cutoff in the state file should be updated or not, uses 'localhost' as a nodename for PBS remotes, since at the point where it is instantiated, we don't know the real hostname of a PBS remote. This means that we have to also use 'localhost' where we lookup the status in the node success map, otherwise the state file will never contain entries for PBS remotes, leading to the refresh task always requesting a full task history. Signed-off-by: Lukas Wagner --- server/src/remote_tasks/task_cache.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/server/src/remote_tasks/task_cache.rs b/server/src/remote_tasks/task_cache.rs index b0b4a837..b5fc3b21 100644 --- a/server/src/remote_tasks/task_cache.rs +++ b/server/src/remote_tasks/task_cache.rs @@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize}; use proxmox_sys::fs::CreateOptions; -use pdm_api_types::RemoteUpid; +use pdm_api_types::{RemoteUpid, remotes::RemoteType}; /// Filename for the file containing running tasks. const ACTIVE_FILENAME: &str = "active"; @@ -424,7 +424,12 @@ impl WritableTaskCache { } }; - let node = native_upid.node(); + let node = match task.upid.remote_type() { + RemoteType::Pve => native_upid.node(), + // The node success map uses 'localhost' as a node name for PBS remotes, + // not the one from the UPID. + RemoteType::Pbs => "localhost", + }; let remote = task.upid.remote(); if node_success_map.node_successful(remote, node) { @@ -449,7 +454,12 @@ impl WritableTaskCache { } }; - let node = native_upid.node(); + let node = match task.upid.remote_type() { + RemoteType::Pve => native_upid.node(), + // The node success map uses 'localhost' as a node name for PBS remotes, + // not the one from the UPID. + RemoteType::Pbs => "localhost", + }; let remote = task.upid.remote(); if node_success_map.node_successful(remote, node) { -- 2.47.3