public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] tasks: improve behaviour on upgrade
Date: Wed, 30 Sep 2020 10:45:06 +0200	[thread overview]
Message-ID: <20200930084507.16006-1-d.csapak@proxmox.com> (raw)

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@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





             reply	other threads:[~2020-09-30  8:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30  8:45 Dominik Csapak [this message]
2020-09-30  8:45 ` [pbs-devel] [PATCH proxmox-backup 2/2] ui: improve running task overlay Dominik Csapak
2020-09-30  9:07   ` [pbs-devel] applied: " Dietmar Maurer
2020-09-30  9:07 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] tasks: improve behaviour on upgrade Dietmar Maurer

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=20200930084507.16006-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal