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 235821FF141 for ; Tue, 02 Jun 2026 16:01:58 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A0B7415F42; Tue, 2 Jun 2026 16:01:56 +0200 (CEST) Message-ID: <0a1ec8d4-bf80-4596-a37c-7a764d990fd8@proxmox.com> Date: Tue, 2 Jun 2026 16:01:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH datacenter-manager 0/6] fix #7639: task cache: consider running tasks when updating the cutoff timestamp To: Lukas Wagner , pdm-devel@lists.proxmox.com References: <20260529133951.326103-1-l.wagner@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20260529133951.326103-1-l.wagner@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1780408876871 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.049 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 Message-ID-Hash: 3UMIEIKFRZMIDEATQZXZMJCIH6V5COXW X-Message-ID-Hash: 3UMIEIKFRZMIDEATQZXZMJCIH6V5COXW X-MailFrom: d.csapak@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: didn't test yet (hopefully i have time tomorrow for that) but the code LGTM with one minor nit (see the answer to the relevant patch) Aside from that: Reviewed-by: Dominik Csapak On 5/29/26 3:39 PM, Lukas Wagner wrote: > 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(-) >