[pbs-devel] [PATCH proxmox-backup] api2/tape/backup: wait indefinitely for lock in scheduled backup jobs

Dietmar Maurer dietmar at proxmox.com
Thu Mar 18 07:04:49 CET 2021


> +            let (job_result, summary) = match try_block!({
> +                if schedule.is_some() {
> +                    // for scheduled tape backup jobs, we wait indefinitely for the lock
> +                    task_log!(worker, "waiting for drive lock...");
> +                    loop {
> +                        if let Ok(lock) = lock_tape_device(&drive_config, &setup.drive) {
> +                            drive_lock = Some(lock);
> +                            break;
> +                        } // ignore errors

I would prefer to add a timeout parameter to lock_tape_device() call.
The question is if the lock call gets interrupted by task abort?

> +
> +                        worker.check_abort()?;
> +                    }
> +                }
> +                set_tape_device_state(&setup.drive, &worker.upid().to_string())?;





More information about the pbs-devel mailing list