Skip to content

Commit 743a02d

Browse files
jainprfacebook-github-bot
authored andcommitted
Check for yields while waiting for lock in a loop (#13498)
Summary: Acquiring a lock here can take a long time and cause a user mode scheduler to hold up, as it relies on explicit yielding. Hence, forcing a check here but ignoring any abort requests. Would rely on upstream to take action on aborts. Pull Request resolved: #13498 Reviewed By: pdillinger Differential Revision: D71987173 Pulled By: jainpr fbshipit-source-id: 4aec40bdf0bc657e29f72c306c576b3117f97a25
1 parent 9072f5d commit 743a02d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

utilities/transactions/lock/point/point_lock_manager.cc

+3
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ Status PointLockManager::AcquireWithTimeout(
318318
} else {
319319
uint64_t now = env->NowMicros();
320320
if (static_cast<uint64_t>(cv_end_time) > now) {
321+
// This may be invoked multiple times since we divide
322+
// the time into smaller intervals.
323+
(void)ROCKSDB_THREAD_YIELD_CHECK_ABORT();
321324
result = stripe->stripe_cv->WaitFor(stripe->stripe_mutex,
322325
cv_end_time - now);
323326
}

0 commit comments

Comments
 (0)