Skip to main content

Module entity_lock

Module entity_lock 

Source
Expand description

Advisory entity locking for multi-agent GraphStore coordination (#2478).

SQLite does not provide row-level locks. This module implements a soft advisory locking pattern using a dedicated entity_advisory_locks table. Locks are automatically expired after 120 seconds (covers worst-case slow LLM calls).

Expired locks are reclaimed on the next try_acquire call rather than via a cleanup sweep. When a lock is reclaimed by another session, the original holder’s subsequent writes follow last-writer-wins semantics — acceptable for entity resolution where duplicate entities can be merged in a later consolidation sweep.

Structs§

EntityLockManager
Advisory entity lock manager for a single session.