Commit Graph
4 Commits
Author SHA1 Message Date
guojidanandGitHub d4beb1cc0b Fix lock (#510)
* Refactor: reimplement lock

Signed-off-by: junxiang Mu <[email protected]>

* Fix: fix test case failed

Signed-off-by: junxiang Mu <[email protected]>

* Improve: lock pref

Signed-off-by: junxiang Mu <[email protected]>

* fix(lock): Fix resource cleanup issue when batch lock acquisition fails
Ensure that the locks already acquired are properly released when batch lock acquisition fails to avoid memory leaks
Improve the lock protection mechanism to prevent double release issues
Add complete Apache license declarations to all files

Signed-off-by: junxiang Mu <[email protected]>

---------

Signed-off-by: junxiang Mu <[email protected]>
2025-09-11 12:10:35 +08:00
junxiang Mu cad005bc21 refactor(lock): unify NamespaceLock client model and LockRequest API
- Refactor NamespaceLock to use a unified client vector and quorum mechanism,
  removing legacy local/distributed lock split and related code.
- Update LockRequest to split timeout into acquire_timeout and ttl, and add
  builder methods for both.
- Adjust all batch lock APIs to accept ttl and use new LockRequest fields.
- Update all affected tests and documentation for the new API.

Signed-off-by: junxiang Mu <[email protected]>
2025-07-24 11:52:57 +08:00
rootandjunxiang Mu dc44cde081 tmp
Signed-off-by: root <[email protected]>
2025-07-24 11:52:57 +08:00
dandanandjunxiang Mu 4ccdeb9d2a refactor(lock): restructure lock crate, remove unused modules and clarify directory layout
- Remove unused core/rwlock.rs and manager/ modules (ManagerFactory, LifecycleManager, NamespaceManager)
- Move all lock-related code into crates/lock/src with clear submodules: client, core, utils, etc.
- Ensure only necessary files and APIs are exposed, improve maintainability
- No functional logic change, pure structure and cleanup refactor

Signed-off-by: dandan <[email protected]>
2025-07-24 11:52:55 +08:00