Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
motr_sync: [CORTX-33853] Support race coditions during lock acquisition.
Browse files Browse the repository at this point in the history
Changed lock() implementation to avoid multiple KV operations, thereby
reducing the effect of race during lock() call by caller.

Signed-off-by: Dattaprasad Govekar <dattaprasad.govekar@seagate.com>
  • Loading branch information
DPG17 committed Aug 9, 2022
1 parent 292c71d commit 6a23581
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rgw/motr/sync/motr_sync_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ int MotrLock::check_lock(const std::string& lock_name,
return rc;
}
}
return -EBUSY;
} else if (rc == -ENOENT) {
// Looks like lock object is deleted by another caller
// as part of the race condition
return -EBUSY;
}
return -EBUSY;
}

int MotrKVLockProvider::read_lock(const std::string& lock_name,
Expand Down

0 comments on commit 6a23581

Please sign in to comment.