public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* SPAM: [PATCH datacenter-manager 0/2] Remove running tasks from
@ 2026-08-28 15:49 Jonas Theisen
  2026-08-28 15:49 ` [PATCH datacenter-manager 1/2] api: Remove running tasks from errors output Jonas Theisen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jonas Theisen @ 2026-08-28 15:49 UTC (permalink / raw)
  To: pdm-devel

This patch series fixes issues with filtering for errored tasks
where running tasks would get wrongly displayed or returned through
the API.

The first patch is analogous to the patch suggested for PBS in [1]
and fixes the PDM local tasks returned by the API when queried for
errors.

The second patch was added to align the behavior of tasks imported
from PVE to the tasks from PBS or returned by PDM.
This indirectly also fixes the issue that running PVE tasks get
displayed in the Remote tab of PDM when filtering for errors
while running PBS tasks got correctly filtered out.

[1] https://lore.proxmox.com/pbs-devel/20260827154740.427154-1-j.theisen@proxmox.com/

Jonas Theisen (2):
  api: Remove running tasks from errors output
  remote-tasks: Align fetched PVE tasks to PBS and PDM API

 server/src/api/nodes/tasks.rs           | 1 +
 server/src/remote_tasks/refresh_task.rs | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

-- 
2.47.3





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH datacenter-manager 1/2] api: Remove running tasks from errors output
  2026-08-28 15:49 SPAM: [PATCH datacenter-manager 0/2] Remove running tasks from Jonas Theisen
@ 2026-08-28 15:49 ` Jonas Theisen
  2026-08-28 15:49 ` [PATCH datacenter-manager 2/2] remote-tasks: Align fetched PVE tasks to PBS and PDM API Jonas Theisen
  2026-08-31 11:26 ` applied: [PATCH datacenter-manager 0/2] Remove running tasks from Lukas Wagner
  2 siblings, 0 replies; 4+ messages in thread
From: Jonas Theisen @ 2026-08-28 15:49 UTC (permalink / raw)
  To: pdm-devel

Currently running tasks are returned by the PDM API in the query
for errored tasks.
This patch adds an additional condition to filter out running tasks
when queried for errored tasks

This is related to the patch suggested for the PBS API at
https://lore.proxmox.com/pbs-devel/20260827154740.427154-1-j.theisen@proxmox.com/

Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
 server/src/api/nodes/tasks.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/server/src/api/nodes/tasks.rs b/server/src/api/nodes/tasks.rs
index 31ddb8f1..1cca3c0a 100644
--- a/server/src/api/nodes/tasks.rs
+++ b/server/src/api/nodes/tasks.rs
@@ -155,6 +155,7 @@ pub fn list_tasks(
                     continue;
                 }
             }
+            (None, _) if errors => continue,
             (None, Some(_)) => continue,
             _ => {}
         }
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH datacenter-manager 2/2] remote-tasks: Align fetched PVE tasks to PBS and PDM API
  2026-08-28 15:49 SPAM: [PATCH datacenter-manager 0/2] Remove running tasks from Jonas Theisen
  2026-08-28 15:49 ` [PATCH datacenter-manager 1/2] api: Remove running tasks from errors output Jonas Theisen
@ 2026-08-28 15:49 ` Jonas Theisen
  2026-08-31 11:26 ` applied: [PATCH datacenter-manager 0/2] Remove running tasks from Lukas Wagner
  2 siblings, 0 replies; 4+ messages in thread
From: Jonas Theisen @ 2026-08-28 15:49 UTC (permalink / raw)
  To: pdm-devel

Running tasks fetched from PVE's API have the status "RUNNING"
while PBS and PDM have None.
Since the filtering logic in PDM also expects the state to be None
for running tasks this patch aligns the status of fetched tasks.

With this applied running PVE tasks no longer display when filtering
for errored tasks in the Remote tab of PDM.

Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
 server/src/remote_tasks/refresh_task.rs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/server/src/remote_tasks/refresh_task.rs b/server/src/remote_tasks/refresh_task.rs
index 668b63e4..3275bdb8 100644
--- a/server/src/remote_tasks/refresh_task.rs
+++ b/server/src/remote_tasks/refresh_task.rs
@@ -504,11 +504,17 @@ async fn poll_single_tracked_task(remote: Remote, task: RemoteUpid) -> (RemoteUp
 fn map_pve_task(task: pve_api_types::ListTasksResponse, remote: String) -> TaskCacheItem {
     let remote_upid = RemoteUpid::new(remote, RemoteType::Pve, task.upid);
 
+    // This is to align the PVE tasks to PBS and PDM tasks
+    let status = match task.status {
+        Some(ref s) if s == "RUNNING" => None,
+        other => other,
+    };
+
     TaskCacheItem {
         upid: remote_upid,
         starttime: task.starttime,
         endtime: task.endtime,
-        status: task.status,
+        status: status,
     }
 }
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* applied: [PATCH datacenter-manager 0/2] Remove running tasks from
  2026-08-28 15:49 SPAM: [PATCH datacenter-manager 0/2] Remove running tasks from Jonas Theisen
  2026-08-28 15:49 ` [PATCH datacenter-manager 1/2] api: Remove running tasks from errors output Jonas Theisen
  2026-08-28 15:49 ` [PATCH datacenter-manager 2/2] remote-tasks: Align fetched PVE tasks to PBS and PDM API Jonas Theisen
@ 2026-08-31 11:26 ` Lukas Wagner
  2 siblings, 0 replies; 4+ messages in thread
From: Lukas Wagner @ 2026-08-31 11:26 UTC (permalink / raw)
  To: Jonas Theisen, pdm-devel

On Fri Aug 28, 2026 at 5:49 PM CEST, Jonas Theisen wrote:
> This patch series fixes issues with filtering for errored tasks
> where running tasks would get wrongly displayed or returned through
> the API.
>
> The first patch is analogous to the patch suggested for PBS in [1]
> and fixes the PDM local tasks returned by the API when queried for
> errors.
>
> The second patch was added to align the behavior of tasks imported
> from PVE to the tasks from PBS or returned by PDM.
> This indirectly also fixes the issue that running PVE tasks get
> displayed in the Remote tab of PDM when filtering for errors
> while running PBS tasks got correctly filtered out.
>
> [1] https://lore.proxmox.com/pbs-devel/20260827154740.427154-1-j.theisen@proxmox.com/
>
> Jonas Theisen (2):
>   api: Remove running tasks from errors output
>   remote-tasks: Align fetched PVE tasks to PBS and PDM API
>
>  server/src/api/nodes/tasks.rs           | 1 +
>  server/src/remote_tasks/refresh_task.rs | 8 +++++++-
>  2 files changed, 8 insertions(+), 1 deletion(-)

applied, thanks!

I slightly touched up the commit messages, but nothing major.

I also directly followed up with a patch for the remote-tasks API. While
you fixed the discrepancies between PBS and PVE tasks, you forgot to add
the additional condition to the remote-tasks API, so running tasks where
still included in the API response when `errors` as set.

https://git.proxmox.com/?p=proxmox-datacenter-manager.git;a=commitdiff;h=c3ca3a8179164d9773cc67cbe1a7e821ec80666c




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-31 11:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28 15:49 SPAM: [PATCH datacenter-manager 0/2] Remove running tasks from Jonas Theisen
2026-08-28 15:49 ` [PATCH datacenter-manager 1/2] api: Remove running tasks from errors output Jonas Theisen
2026-08-28 15:49 ` [PATCH datacenter-manager 2/2] remote-tasks: Align fetched PVE tasks to PBS and PDM API Jonas Theisen
2026-08-31 11:26 ` applied: [PATCH datacenter-manager 0/2] Remove running tasks from Lukas Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal