[pbs-devel] [PATCH proxmox-backup] task tracking: improve pruning of reused-PID stale entries

Hannes Laimer h.laimer at proxmox.com
Mon Nov 17 09:58:13 CET 2025


Keep entries only when check_process_running(pid) reports a
starttime equal to the stored one. This improves pruning of stale
entries for all PIDs (not just the current one) and aligns update
with the read path. Counting behavior and semantics are unchanged.

Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
noticed while looking through recent proposed changes to the tracking
logic. this isn't a problem, but should keep the tracking file cleaner
and remove a match arm in the code

 pbs-datastore/src/task_tracking.rs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pbs-datastore/src/task_tracking.rs b/pbs-datastore/src/task_tracking.rs
index 44a4522d..4fcbbaa4 100644
--- a/pbs-datastore/src/task_tracking.rs
+++ b/pbs-datastore/src/task_tracking.rs
@@ -114,8 +114,7 @@ pub fn update_active_operations(
             .iter_mut()
             .filter_map(
                 |task| match procfs::check_process_running(task.pid as pid_t) {
-                    Some(stat) if pid == task.pid && stat.starttime != task.starttime => None,
-                    Some(_) => {
+                    Some(stat) if stat.starttime == task.starttime => {
                         if pid == task.pid {
                             found_entry = true;
                             match operation {
-- 
2.47.3





More information about the pbs-devel mailing list