mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-17 14:42:06 +00:00
fix(memory): resolve() the shared-connection registry key; symlink test
Follow-ups for salvaged PR #43819: the registry key was str(Path(db_path).expanduser()) — a symlinked or relative path to the same DB file got its own connection, silently reintroducing the exact multi-writer contention the registry prevents. Key on Path.resolve() (OSError-tolerant fallback). Adds a symlink regression test and the AUTHOR_MAP entry for adambiggs.
This commit is contained in:
parent
b5226caff8
commit
a801046669
3 changed files with 26 additions and 1 deletions
|
|
@ -129,7 +129,13 @@ class MemoryStore:
|
|||
self._hrr_available = hrr._HAS_NUMPY
|
||||
|
||||
# Acquire (or open) the process-wide shared connection for this DB.
|
||||
self._key = str(self.db_path)
|
||||
# resolve() (not just expanduser) so symlinked/relative paths to the
|
||||
# same file share ONE connection instead of silently reintroducing
|
||||
# the multi-writer contention this registry exists to prevent.
|
||||
try:
|
||||
self._key = str(self.db_path.resolve())
|
||||
except OSError:
|
||||
self._key = str(self.db_path)
|
||||
with MemoryStore._shared_guard:
|
||||
entry = MemoryStore._shared.get(self._key)
|
||||
if entry is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue