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

Request for Non-blocking API Equivalent to Go's etcd client TryLock in jetcd #1305

Open
bootjp opened this issue Jan 25, 2024 · 2 comments
Open

Comments

@bootjp
Copy link

bootjp commented Jan 25, 2024

Is your feature request related to a problem? Please describe.
I am currently encountering a limitation with the jetcd (Java client for etcd) regarding lock acquisition functionality. I am in need of a feature similar to the TryLock method in Go's etcd client (client/v3/concurrency/mutex.go). The lack of a non-blocking API to attempt acquiring a lock in jetcd presents a significant challenge for my use case.

Describe the solution you'd like
I am looking for the implementation of a non-blocking lock acquisition API in Java's LockClient, similar to the TryLock method in Go's etcd client. The reference Go implementation is here: Go etcd TryLock. Such a method is crucial for scenarios where blocking behavior is not suitable or practical.

Describe alternatives you've considered
I have contemplated using a timeout mechanism in Java for lock acquisition, where a lock attempt is considered unsuccessful if it is not secured within a set time. However, this is not a true non-blocking approach and necessitates caution on the part of developers when calling it. A client-side solution, transparent like in the Go implementation, would be more desirable.

Additional context
Adding this feature would bring jetcd more in line with the Go client's capabilities, enhancing its utility for Java developers interfacing with etcd. It is particularly important for high-concurrency environments or situations where minimizing response time is essential.

Implementation and Contribution Inquiry
I would like to know if there are any plans to implement such a feature in jetcd. Additionally, I am interested in whether the project would be open to accepting a Pull Request for this feature, should there be no current plans for its implementation.

@liangyuanpeng
Copy link
Contributor

There was an issue that raised this issue before , which is only possible if the etcd server implements the relevant grpc methods.

It would be great if you would like to contribute.

/kind feature

Related:

@k8s-ci-robot
Copy link

@liangyuanpeng: The label(s) kind/feature cannot be applied, because the repository doesn't have them.

In response to this:

There was an issue that raised this issue before , which is only possible if the etcd server implements the relevant grpc methods.

It would be great if you would like to contribute.

/kind feature

Related:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants