From 6a23581a43ddaa3c36cb3b982d8c378d615e72ff Mon Sep 17 00:00:00 2001 From: Dattaprasad Govekar Date: Tue, 9 Aug 2022 01:56:13 -0600 Subject: [PATCH] motr_sync: [CORTX-33853] Support race coditions during lock acquisition. Changed lock() implementation to avoid multiple KV operations, thereby reducing the effect of race during lock() call by caller. Signed-off-by: Dattaprasad Govekar --- src/rgw/motr/sync/motr_sync_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/motr/sync/motr_sync_impl.cc b/src/rgw/motr/sync/motr_sync_impl.cc index a44569c53df660..bfb05805fc596c 100644 --- a/src/rgw/motr/sync/motr_sync_impl.cc +++ b/src/rgw/motr/sync/motr_sync_impl.cc @@ -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,