fix bug #3060: continue sync if we cannot aquire the group lock

This commit is contained in:
Dietmar Maurer 2020-11-10 10:54:36 +01:00
parent 9f0ee346e9
commit 30f73fa2e0
1 changed files with 10 additions and 1 deletions

View File

@ -528,7 +528,16 @@ pub async fn pull_store(
for (groups_done, item) in list.into_iter().enumerate() { for (groups_done, item) in list.into_iter().enumerate() {
let group = BackupGroup::new(&item.backup_type, &item.backup_id); let group = BackupGroup::new(&item.backup_type, &item.backup_id);
let (owner, _lock_guard) = tgt_store.create_locked_backup_group(&group, &auth_id)?; let (owner, _lock_guard) = match tgt_store.create_locked_backup_group(&group, &auth_id) {
Ok(result) => result,
Err(err) => {
worker.log(format!("sync group {}/{} failed - group lock failed: {}",
item.backup_type, item.backup_id, err));
errors = true; // do not stop here, instead continue
continue;
}
};
// permission check // permission check
if auth_id != owner { // only the owner is allowed to create additional snapshots if auth_id != owner { // only the owner is allowed to create additional snapshots
worker.log(format!("sync group {}/{} failed - owner check failed ({} != {})", worker.log(format!("sync group {}/{} failed - owner check failed ({} != {})",