From: Lukas Wagner <l.wagner@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager 2/2] remote tasks: make sure to update the task cache if there were errors when polling
Date: Fri, 28 Nov 2025 15:05:22 +0100 [thread overview]
Message-ID: <20251128140522.311838-3-l.wagner@proxmox.com> (raw)
In-Reply-To: <20251128140522.311838-1-l.wagner@proxmox.com>
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@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
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-11-28 14:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-28 14:05 [pdm-devel] [PATCH datacenter-manager 0/2] remote tasks: avoid stuck running tasks Lukas Wagner
2025-11-28 14:05 ` [pdm-devel] [PATCH datacenter-manager 1/2] remote tasks: poll foreign, non-tracked active tasks to avoid them getting stuck Lukas Wagner
2025-11-28 14:05 ` Lukas Wagner [this message]
2025-11-30 1:17 ` [pdm-devel] applied: [PATCH datacenter-manager 0/2] remote tasks: avoid stuck running tasks Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251128140522.311838-3-l.wagner@proxmox.com \
--to=l.wagner@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox