Skip to content

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

fix(path_lock): restore 'Still waiting for lock' progress logs disabled by #2700 (#2768)

Evo1494bdeae70c
diff --git a/openviking/storage/transaction/path_lock.py b/openviking/storage/transaction/path_lock.py
index b595bfcb2..3a7fc212a 100644
--- a/openviking/storage/transaction/path_lock.py
+++ b/openviking/storage/transaction/path_lock.py
@@ -487,7 +487,8 @@ class PathLockEngine:
if await self._has_owned_ancestor_tree(path, owner):
logger.debug(f"[EXACT] Reusing owned ancestor TREE lock on: {path}")
return True
- if timeout is None:
+ had_no_timeout = timeout is None
+ if had_no_timeout:
timeout = self._lock_expire
deadline = asyncio.get_running_loop().time() + timeout
wait_start = asyncio.get_running_loop().time()
@@ -504,7 +505,7 @@ class PathLockEngine:
_log_timeout_waiting(f"[EXACT] Timeout waiting for exact lock on: {path}")
return False
now = asyncio.get_running_loop().time()
- if timeout is None and now >= next_wait_log_at:
+ if had_no_timeout and now >= next_wait_log_at:
logger.info(
f"[EXACT] Still waiting for lock on: {path} "
f"(waited={now - wait_start:.1f}s)"
@@ -543,7 +544,7 @@ class PathLockEngine:
)
return False
now = asyncio.get_running_loop().time()
- if timeout is None and now >= next_wait_log_at:
+ if had_no_timeout and now >= next_wait_log_at:
logger.info(
f"[EXACT] Still waiting for ancestor TREE lock: {ancestor_conflict} "
f"(path={path}, waited={now - wait_start:.1f}s)"
@@ -596,7 +597,7 @@ class PathLockEngine:
await self._remove_lock_file(lock_path)
return False
now = asyncio.get_running_loop().time()
- if timeout is None and now >= next_wait_log_at:
+ if had_no_timeout and now >= next_wait_log_at:
logger.info(
f"[EXACT] Still waiting after conflict check on: {path} "
f"(waited={now - wait_start:.1f}s)"
@@ -610,7 +611,7 @@ class PathLockEngine:
if asyncio.get_running_loop().time() >= deadline:
return False
now = asyncio.get_running_loop().time()
- if timeout is None and now >= next_wait_log_at:
+ if had_no_timeout and now >= next_wait_log_at:
logger.info(
f"[EXACT] Still waiting for lock ownership verification: {path} "
f"(waited={now - wait_start:.1f}s)"
@@ -640,7 +641,8 @@ class PathLockEngine:
if await self._has_owned_ancestor_tree(path, owner):
logger.debug(f"[TREE] Reusing owned ancestor TREE lock on: {path}")
return True
- if timeout is None:
+ had_no_timeout = timeout is None
+ if had_no_timeout:
timeout = self._lock_expire
deadline = asyncio.get_running_loop().time() + timeout
wait_start = asyncio.get_running_loop().time()
@@ -656,7 +658,7 @@ class PathLockEngine:
_log_timeout_waiting(f"[TREE] Timeout waiting for lock on: {path}")
return False
now = asyncio.get_running_loop().time()
- if timeout is None and now >= next_wait_log_at:
+ if had_no_timeout and now >= next_wait_log_at:
logger.info(
f"[TREE] Still waiting for lock on: {path} (waited={now - wait_start:.1f}s)"
)
@@ -677,7 +679,7 @@ class PathLockEngine:
)
return False
now = asyncio.get_running_loop().time()
- if timeout is None and now >= next_wait_log_at:
+ if had_no_timeout and now >= next_wait_log_at:
logger.info(
f"[TREE] Still waiting for ancestor TREE lock: {ancestor_conflict} "
f"(path={path}, waited={now - wait_start:.1f}s)"
@@ -710,7 +712,7 @@ class PathLockEngine:
)
return False
now = asyncio.get_running_loop().time()
- if timeout is None and now >= next_wait_log_at:
+ if had_no_timeout and now >= next_wait_log_at:
logger.info(
f"[TREE] Still waiting for descendant lock: {desc_conflict} "
f"(path={path}, waited={now - wait_start:.1f}s)"
@@ -752,7 +754,7 @@ class PathLockEngine:
await self._remove_lock_file(lock_path)
return False
now = asyncio.get_running_loop().time()
- if timeout is None and now >= next_wait_log_at:
+ if had_no_timeout and now >= next_wait_log_at:
logger.info(
f"[TREE] Still waiting after conflict check on: {path} "
f"(waited={now - wait_start:.1f}s)"
@@ -766,7 +768,7 @@ class PathLockEngine:
if asyncio.get_running_loop().time() >= deadline:
return False
now = asyncio.get_running_loop().time()
- if timeout is None and now >= next_wait_log_at:
+ if had_no_timeout and now >= next_wait_log_at:
logger.info(
f"[TREE] Still waiting for lock ownership verification: {path} "
f"(waited={now - wait_start:.1f}s)"