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 etcd Lock bugs #186

Merged
merged 2 commits into from
Dec 19, 2017
Merged

Fix etcd Lock bugs #186

merged 2 commits into from
Dec 19, 2017

Conversation

jlhawn
Copy link
Contributor

@jlhawn jlhawn commented Dec 18, 2017

  1. Any connection errors on the first key Set attempt may
    cause 2 clients to think they have acquired the lock if
    the second set attempt succeeds.
  2. The wait loop was not checking for 'compareAndDelete'
    events which means that a client may never retry to set
    the lock key.

Josh Hawn added 2 commits December 18, 2017 12:53
1. Any connection errors on the first key Set attempt may
   cause 2 clients to think they have acquired the lock if
   the second set attempt succeeds.
2. The wait loop was not checking for 'compareAndDelete'
   events which means that a client may never retry to set
   the lock key.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
First, run each test case as separate sub-tests.

Added a test case for Consul and etcd which asserts that clients
correctly block if the lock key is already held by another client.
It also tests that the waiting client unblocks once the lock is
released.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
@vieux
Copy link
Contributor

vieux commented Dec 19, 2017

LGTM

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.

None yet

2 participants