Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

fix(path_lock): fall back to lock_expire when timeout is None (#2698) (#2700)

Andrew Vavilchenkocab0d525abda
diff --git a/openviking/storage/transaction/path_lock.py b/openviking/storage/transaction/path_lock.py
index 12e40ff42..b595bfcb2 100644
--- a/openviking/storage/transaction/path_lock.py
+++ b/openviking/storage/transaction/path_lock.py
@@ -488,9 +488,8 @@ class PathLockEngine:
logger.debug(f"[EXACT] Reusing owned ancestor TREE lock on: {path}")
return True
if timeout is None:
- deadline = float("inf")
- else:
- deadline = asyncio.get_running_loop().time() + timeout
+ timeout = self._lock_expire
+ deadline = asyncio.get_running_loop().time() + timeout
wait_start = asyncio.get_running_loop().time()
next_wait_log_at = wait_start + _WAIT_LOG_INTERVAL
@@ -642,11 +641,8 @@ class PathLockEngine:
logger.debug(f"[TREE] Reusing owned ancestor TREE lock on: {path}")
return True
if timeout is None:
- # 无限等待
- deadline = float("inf")
- else:
- # 有限超时
- deadline = asyncio.get_running_loop().time() + timeout
+ timeout = self._lock_expire
+ deadline = asyncio.get_running_loop().time() + timeout
wait_start = asyncio.get_running_loop().time()
next_wait_log_at = wait_start + _WAIT_LOG_INTERVAL