Merge branch 'feature/cog-3142-agentic-use-case-kuzu-lock-fix-redis-integration' into feature/cog-3160-redis-session-conversation

This commit is contained in:
hajdul88 2025-10-16 12:05:05 +02:00 committed by GitHub
commit 36fd44dab2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View file

@ -15,7 +15,7 @@ class CacheDBInterface(ABC):
self.lock = None
@abstractmethod
def acquire(self):
def acquire_lock(self):
"""
Acquire a lock on the given key.
Must be implemented by subclasses.
@ -23,7 +23,7 @@ class CacheDBInterface(ABC):
pass
@abstractmethod
def release(self):
def release_lock(self):
"""
Release the lock if it is held.
Must be implemented by subclasses.
@ -31,7 +31,7 @@ class CacheDBInterface(ABC):
pass
@contextmanager
def hold(self):
def hold_lock(self):
"""
Context manager for safely acquiring and releasing the lock.
"""

View file

@ -27,7 +27,7 @@ class RedisAdapter(CacheDBInterface):
self.timeout = timeout
self.blocking_timeout = blocking_timeout
def acquire(self):
def acquire_lock(self):
"""
Acquire the Redis lock manually. Raises if acquisition fails. (Sync because of Kuzu)
"""
@ -43,7 +43,7 @@ class RedisAdapter(CacheDBInterface):
return self.lock
def release(self):
def release_lock(self):
"""
Release the Redis lock manually, if held. (Sync because of Kuzu)
"""
@ -55,7 +55,7 @@ class RedisAdapter(CacheDBInterface):
pass
@contextmanager
def hold(self):
def hold_lock(self):
"""
Context manager for acquiring and releasing the Redis lock automatically. (Sync because of Kuzu)
"""

View file

@ -225,7 +225,7 @@ class KuzuAdapter(GraphDBInterface):
lock_acquired = False
try:
if cache_config.shared_kuzu_lock:
self.redis_lock.acquire()
self.redis_lock.acquire_lock()
lock_acquired = True
if not self.connection:
logger.info("Reconnecting to Kuzu database...")
@ -252,7 +252,7 @@ class KuzuAdapter(GraphDBInterface):
try:
self.close()
finally:
self.redis_lock.release()
self.redis_lock.release_lock()
if cache_config.shared_kuzu_lock:
async with self._connection_change_lock: