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

Rework locking in ringpop-go #113

Open
motiejus opened this issue Feb 23, 2016 · 0 comments
Open

Rework locking in ringpop-go #113

motiejus opened this issue Feb 23, 2016 · 0 comments

Comments

@motiejus
Copy link
Contributor

Locking in ringpop-go is too granular, and is giving us headaches:

  1. There are many module-level and datastructure-level locks which are difficult to reason about. That makes it difficult to refactor anything that changes way the critical sections are locked, and is hard to do right without adding new race conditions or deadlocks (ask @motiejus).
  2. When we need to fix a race condition that we know about, to avoid (1), we fall back into adding yet another lock. For example, see Fix race in membership and ring consistency #112.

To fix this, we agreed to do the following:

  1. Make locking much more coarse: ideally, only one lock in Ringpop. The lock would be acquired when ringpop code is entered via API or network call (and released when a network call is made). That way we would know that whenever ringpop is mutating or reading its state, the lock is locked.
  2. Remove all the other locks.
  3. Win!
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

No branches or pull requests

1 participant