[pbs-devel] [PATCH proxmox-backup 1/2] tasks: improve behaviour on upgrade
Dominik Csapak
d.csapak at proxmox.com
Wed Sep 30 10:45:06 CEST 2020
when upgrading from a version where we stored all tasks in the 'active' file,
we did not completly account for finished tasks still there
we should update the file when encountering any finished task in
'active' as well as filter them out on the api call (if they get through)
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
src/api2/node/tasks.rs | 1 +
src/server/worker_task.rs | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/api2/node/tasks.rs b/src/api2/node/tasks.rs
index 80384ea8..1440859b 100644
--- a/src/api2/node/tasks.rs
+++ b/src/api2/node/tasks.rs
@@ -352,6 +352,7 @@ pub fn list_tasks(
}
match info.state {
+ Some(_) if running => return None,
Some(crate::server::TaskState::OK { .. }) if errors => return None,
_ => {},
}
diff --git a/src/server/worker_task.rs b/src/server/worker_task.rs
index be689c7f..b2e2abd5 100644
--- a/src/server/worker_task.rs
+++ b/src/server/worker_task.rs
@@ -539,7 +539,7 @@ impl TaskListInfoIterator {
let needs_update = active_list
.iter()
- .any(|info| info.state.is_none() && !worker_is_active_local(&info.upid));
+ .any(|info| info.state.is_some() || !worker_is_active_local(&info.upid));
if needs_update {
drop(lock);
--
2.20.1
More information about the pbs-devel
mailing list