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

Write our own distributed locking (async etcd3 with concurrency API or aioredis v2 redlock) #383

Closed
achimnol opened this issue Mar 4, 2022 · 0 comments · Fixed by lablup/backend.ai-common#124
Assignees
Labels
area:upstream Issues with root cause from upstream 3rd parties effort:epic Need to split into multiple sub-issues (epic).

Comments

@achimnol
Copy link
Member

achimnol commented Mar 4, 2022

Currently, Python's etcd3 client libraries have limtied support for latest updates such as concurrency API.

The official grpcio began to support asyncio natively since 1.30.0 release (June 2020) and the import namespace is fixed to grpc.aio in 1.33.2, and it's now 1.44.0.

However, etcd3, aioetcd3, etcd3-aio, aetcd3 libraries have not followed these updates and some of them are relying on a 3rd-party aiogrpc library, which seems to be abandoned in favor of the official grpc.aio. Moreover, all those libraries are not being actively maintained.

Here is an issue about adding concurrency API to aetcd, but it seems not to be active:

Our common.etcd module wraps etcd3 with our own async wrappers, but has many issues such as being unable to cleanly shutdown watcher threads. There have been several attempts to replace the underlying implementation, but none was succssful due to watcher API supports and poor cancellation supports.

Now we desperately need to use a proper global lock implementation where locks can be arbitrarily defined at runtime.
Let's write a new etcd v3 client library using the official grpc.aio including the concurrency API support.
We could also add our own high-level API to periodically generate a specific event via watcher API.

Potential alternatives:

Rejected alternatives:

  • PostgreSQL advisory lock. We are experiencing excessive locking issues with this already, and it has a severe limitation that lock IDs should be represented as predefined integers. We need to be able to define locks with arbitrary names at runtime.
@achimnol achimnol added type:feature Add new features area:upstream Issues with root cause from upstream 3rd parties effort:epic Need to split into multiple sub-issues (epic). labels Mar 4, 2022
@achimnol achimnol changed the title Write our own async etcd3 client library with concurrency API Write our own distributed locking (async etcd3 with concurrency API or aioredis v2 redlock) Mar 4, 2022
@achimnol achimnol removed the type:feature Add new features label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:upstream Issues with root cause from upstream 3rd parties effort:epic Need to split into multiple sub-issues (epic).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants