[pdm-devel] [PATCH datacenter-manager 2/2] remote tasks: make sure to update the task cache if there were errors when polling

Lukas Wagner l.wagner at proxmox.com
Fri Nov 28 15:05:22 CET 2025


This is important since the cache implementation will drop any failed
polled tasks from the active file and from the tracked task list.

One instance where the request can fail is when polling a tasks that has
already been rotated out from the task archive on the remote side.

Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 server/src/bin/proxmox-datacenter-api/tasks/remote_tasks.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/server/src/bin/proxmox-datacenter-api/tasks/remote_tasks.rs b/server/src/bin/proxmox-datacenter-api/tasks/remote_tasks.rs
index c8d50183..c71a0894 100644
--- a/server/src/bin/proxmox-datacenter-api/tasks/remote_tasks.rs
+++ b/server/src/bin/proxmox-datacenter-api/tasks/remote_tasks.rs
@@ -230,7 +230,11 @@ async fn do_tick(task_state: &mut TaskState) -> Result<(), Error> {
 
     let (all_tasks, update_state_for_remote) = fetch_remotes(remotes, Arc::new(cache_state)).await;
 
-    if !all_tasks.is_empty() {
+    if !all_tasks.is_empty()
+        || poll_results
+            .iter()
+            .any(|(_, result)| matches!(result, PollResult::RemoteGone | PollResult::RequestError))
+    {
         update_task_cache(cache, all_tasks, update_state_for_remote, poll_results).await?;
     }
 
-- 
2.47.3





More information about the pdm-devel mailing list