-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Problem / Background
The CacheDBInterface class in cognee/infrastructure/databases/cache/cache_db_interface.py has a hold_lock() context manager that calls self.acquire() and self.release() (lines 42, 46), but the abstract methods are defined as acquire_lock() and release_lock() (lines 22, 30). This means hold_lock() will raise AttributeError at runtime for any implementation that correctly follows the interface.
Goal
Fix the method name mismatch so the context manager correctly calls the defined abstract methods.
Proposed Solution
In hold_lock(), change:
self.acquire() → self.acquire_lock()
self.release() → self.release_lock()Or alternatively, rename the abstract methods to match — but the _lock suffix is more descriptive and should be kept.
Acceptance Criteria
-
hold_lock()callsself.acquire_lock()andself.release_lock()correctly - Verify that
RedisAdapterandFSCacheAdapterimplementations are consistent - Add a basic unit test for the context manager protocol
-
ruff check .passes
Dependencies / Blockers
None.
Relevant Links / Resources
- File:
cognee/infrastructure/databases/cache/cache_db_interface.py
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed