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

clientv3/concurrency: Added Mutex.TryLock() #11104

Merged
merged 1 commit into from
Sep 12, 2019

Conversation

vimalk78
Copy link
Contributor

@vimalk78 vimalk78 commented Sep 2, 2019

TryLock locks the mutex if not already locked by another session.
If lock is held by another session, return immediately after attempting necessary cleanup

Fixes #10493

Please read https://github.com/etcd-io/etcd/blob/master/CONTRIBUTING.md#contribution-flow.

@vimalk78
Copy link
Contributor Author

vimalk78 commented Sep 6, 2019

@gyuho , @xiang90 PTAL

@xiang90
Copy link
Contributor

xiang90 commented Sep 6, 2019

lgtm in general. defer to @gyuho

TryLock locks the mutex if not already locked by another session.
If lock is held by another session, return immediately after attempting necessary cleanup

Added integration test

Fixes etcd-io#10493
@xiang90
Copy link
Contributor

xiang90 commented Sep 10, 2019

lgtm

@xiang90
Copy link
Contributor

xiang90 commented Sep 10, 2019

@gyuho you can get this merged if you are ok with it.

@xiang90 xiang90 merged commit 79b15a9 into etcd-io:master Sep 12, 2019
@gyuho
Copy link
Contributor

gyuho commented Sep 12, 2019

@xiang90 Just saw this. Thanks for merging. Changes look good.

@vimalk78 Can you update CHANGELOG?

vimalk78 added a commit to vimalk78/etcd that referenced this pull request Sep 12, 2019
sgotti added a commit to sgotti/agola that referenced this pull request Nov 12, 2019
etcd PR 11104 (etcd-io/etcd#11104) implemented mutex
TryLock. Since it's only available in etcd master just copy relevant code and
add a TODO to remove it when updating the etcd client to a version implementing
TryLock.

Use TryLock everywhere where it'll be useful.
sgotti added a commit to sgotti/agola that referenced this pull request Nov 12, 2019
etcd PR 11104 (etcd-io/etcd#11104) implemented mutex
TryLock. Since it's only available in etcd master just copy relevant code and
add a TODO to remove it when updating the etcd client to a version implementing
TryLock.

Use TryLock everywhere where it'll be useful.
tulliobotti64 pushed a commit to tulliobotti64/agola that referenced this pull request Oct 19, 2022
etcd PR 11104 (etcd-io/etcd#11104) implemented mutex
TryLock. Since it's only available in etcd master just copy relevant code and
add a TODO to remove it when updating the etcd client to a version implementing
TryLock.

Use TryLock everywhere where it'll be useful.
tulliobotti64 pushed a commit to tulliobotti64/agola that referenced this pull request Oct 19, 2022
etcd PR 11104 (etcd-io/etcd#11104) implemented mutex
TryLock. Since it's only available in etcd master just copy relevant code and
add a TODO to remove it when updating the etcd client to a version implementing
TryLock.

Use TryLock everywhere where it'll be useful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

About etcd clientv3 non-blocking distributed locks
4 participants