From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 3B3091FF14C for ; Fri, 29 May 2026 15:40:07 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8CDF8C4EE; Fri, 29 May 2026 15:40:00 +0200 (CEST) From: Lukas Wagner To: pdm-devel@lists.proxmox.com Subject: [PATCH datacenter-manager 0/6] fix #7639: task cache: consider running tasks when updating the cutoff timestamp Date: Fri, 29 May 2026 15:39:45 +0200 Message-ID: <20260529133951.326103-1-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1780061964213 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.053 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Message-ID-Hash: GYDLQT4JOA6AURAIA755YYHO4K43TUBV X-Message-ID-Hash: GYDLQT4JOA6AURAIA755YYHO4K43TUBV 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: At the moment, PDM only polls finished tasks from remote nodes. Considering two tasks: A: starts at 100, ends at 300 B: starts ad 150, ends at 200 If PDM polls the node at t = 250, it would see that B has finished and update the cutoff timestamp for the next poll to 150. However, since A has a starttime of 100, and the cutoff determines the minimum starttime of tasks to retrieve from the remote via the API, PDM would never fetch task A, leading to gaps in the task archive. The solution is to fetch all tasks, running and finished, and then update the cutoff with the oldest running active task in mind. A side effect is that we now also return foreign (as in, not started by PDM) running tasks from the API, which makes them appear in the UI as well. This was always intended as a future extension anyways, so this should be okay. To avoid polled active tasks appearing as 'stuck' until the next regular poll, we also lower the interval in which we poll foreign active tasks to 30 seconds. NOTE to testers/reviewers: An easy way to observe the previously missing tasks is to use the 'Guest Console' as a task with manually controllable duration. For instance: - Start console for VM 100 in the PVE Web UI - Start console for VM 101 in the PVE Web UI -> both start a task that runs as long as the browser actively shows the console - Close console for VM 101 - Force-refresh the task view in PDM -> the console task for VM 101 should now appear (it is finished) - Close console for VM 100 - Force-refresh the task view in PDM -> the console task does NOT show up, since the cutoff has already been set to the start time of the task for VM 101, which started *later* Reported in the community forum: https://forum.proxmox.com/threads/180317/ proxmox-datacenter-manager: Lukas Wagner (6): pdm-api-types: add NativeUpid::node() convenience getter task cache: tests: allow to provide an explicit end time in 'task' helper task cache: tests: add get_cutoff helper task cache: tests: add 'make_cache' convenience helper fix #7639: task cache: consider running tasks when updating the cutoff timestamp task cache: poll known active tasks every 30 seconds lib/pdm-api-types/src/remote_upid.rs | 10 + server/src/remote_tasks/refresh_task.rs | 13 +- server/src/remote_tasks/task_cache.rs | 252 ++++++++++++++---------- 3 files changed, 159 insertions(+), 116 deletions(-) Summary over all repositories: 3 files changed, 159 insertions(+), 116 deletions(-) -- Generated by murpp 0.12.0