From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 6A56A1FF380 for ; Fri, 19 Apr 2024 09:35:09 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 44DB392B; Fri, 19 Apr 2024 09:35:10 +0200 (CEST) Date: Fri, 19 Apr 2024 09:34:37 +0200 (CEST) From: Dietmar Maurer To: Proxmox Backup Server development discussion , Hannes Laimer Message-ID: <8785743.8439.1713512077511@webmail.proxmox.com> In-Reply-To: <212401487.8428.1713511620239@webmail.proxmox.com> References: <20240418142931.122618-1-h.laimer@proxmox.com> <20240418142931.122618-9-h.laimer@proxmox.com> <212401487.8428.1713511620239@webmail.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.346 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" > On 19.4.2024 09:27 CEST Dietmar Maurer wrote: > > > > +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? Oh, I misread how that works - you just log every 5 seconds. But instead, I would log if the message changes. _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel