Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix potential deadlock in RecursiveReadLocker. #14134

Closed
wants to merge 1 commit into from

Conversation

mpoeter
Copy link
Contributor

@mpoeter mpoeter commented May 3, 2021

Scope & Purpose

Fixes a potential deadlock in RecursiveReadLocker. This could happen if some thread A has acquired a read-lock, then some thread B signals that it wants to acquire a write-lock and now thread A recursively wants to acquire another read-lock. Since our ReadWriteLocks usually prefer writers, the second attempt to acquire the read-lock would block, waiting for the writer to finish while the writer would block, waiting for the first read to finish. To solve this, the RecursiveReadLock does no longer follow the principal that writes have precedence over reads.

Should only be merged after #14104

  • 💩 Bugfix (requires CHANGELOG entry)
  • 📖 CHANGELOG entry made

Backports:

  • No backports required

Testing & Verification

  • This PR adds tests that were used to verify all changes:
    • Added new C++ Unit tests

@mpoeter mpoeter added this to the 3.6 milestone May 3, 2021
@mpoeter mpoeter requested a review from jsteemann May 3, 2021 09:46
@mpoeter mpoeter closed this May 3, 2021
@jsteemann jsteemann deleted the bug-fix-3.6/recursive-read-locker branch March 9, 2022 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant