From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 861801FF380 for ; Fri, 19 Apr 2024 09:27:32 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 937C53C1; Fri, 19 Apr 2024 09:27:33 +0200 (CEST) Date: Fri, 19 Apr 2024 09:27:00 +0200 (CEST) From: Dietmar Maurer To: Proxmox Backup Server development discussion , Hannes Laimer Message-ID: <212401487.8428.1713511620239@webmail.proxmox.com> In-Reply-To: <20240418142931.122618-9-h.laimer@proxmox.com> References: <20240418142931.122618-1-h.laimer@proxmox.com> <20240418142931.122618-9-h.laimer@proxmox.com> MIME-Version: 1.0 X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.6-Rev61 X-Originating-Client: open-xchange-appsuite X-SPAM-LEVEL: Spam detection results: 0 AWL 0.347 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup v6 08/23] api2: admin: add (un)mount endpoint for removable datastores X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" > +fn do_unmount_device( > + datastore: DataStoreConfig, > + worker: Option<&dyn WorkerTaskContext>, > +) -> Result<(), Error> { > + let mut active_operations = task_tracking::get_active_operations(&datastore.name)?; > + let mut counter = 0; > + while active_operations.read + active_operations.write > 0 { > + if counter == 0 { > + if let Some(worker) = worker { > + if worker.abort_requested() { > + bail!("aborted, due to user request"); > + } > + task_log!( > + worker, > + "cannot unmount yet, still {} read and {} write operations active", > + active_operations.read, > + active_operations.write > + ); > + } > + counter = 5000; only 5 seconds? > + } > + counter -= 1; > + std::thread::sleep(std::time::Duration::from_millis(1)); do we really need to check every millisecond (I would suggest 250ms)? _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel