[pbs-devel] [PATCH proxmox-backup v6 08/23] api2: admin: add (un)mount endpoint for removable datastores
Dietmar Maurer
dietmar at proxmox.com
Fri Apr 19 09:34:37 CEST 2024
> On 19.4.2024 09:27 CEST Dietmar Maurer <dietmar at proxmox.com> 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.
More information about the pbs-devel
mailing list