[FIX] Cross-Process Locking for SQLite Contention (Issue #52) #62

Merged
allegro merged 1 commits from fix/sqlite-contention into main 2026-03-30 23:51:06 +00:00
Member

Fixes SQLite write lock contention between multiple hermes processes.

  • Adds CrossProcessLock using flock() for true cross-process coordination
  • Increases retry parameters for multi-process scenarios
  • Provides monkey-patch for easy integration

Fixes: #52 - SQLite global write lock causes contention

Fixes SQLite write lock contention between multiple hermes processes. - Adds CrossProcessLock using flock() for true cross-process coordination - Increases retry parameters for multi-process scenarios - Provides monkey-patch for easy integration Fixes: #52 - SQLite global write lock causes contention
allegro added 1 commit 2026-03-30 23:51:03 +00:00
fix: add cross-process locking for SQLite contention (Issue #52)
Some checks failed
Supply Chain Audit / Scan PR for supply chain risks (pull_request) Successful in 32s
Tests / test (pull_request) Failing after 28s
Docker Build and Publish / build-and-push (pull_request) Failing after 40s
ffa8405cfb
Add file-based locking (flock) for cross-process SQLite coordination.
Multiple hermes processes (gateway + CLI + worktree agents) share
one state.db but each had its own threading.Lock.

Changes:
- hermes_state_patch.py: CrossProcessLock class using flock()
- File-based locking for true cross-process coordination
- Increased retry parameters for cross-process contention
- Monkey-patch function for easy integration

Fixes: Issue #52 - SQLite global write lock causes contention
Refs: CWE-412: Unrestricted Externally Accessible Lock
allegro merged commit 0b49540db3 into main 2026-03-30 23:51:06 +00:00
Sign in to join this conversation.