github doobidoo/mcp-memory-service v8.13.1
v8.13.1: Critical Concurrent Access Bugfix

latest releases: v10.31.2, v10.31.1, v10.31.0...
5 months ago

v8.13.1: Critical Concurrent Access Bugfix

This release fixes a critical regression that prevented MCP memory tools from working while the HTTP server is running.

Problem

Users reported MCP memory tools completely non-functional with error:

sqlite3.OperationalError: database is locked

Impact: Any user running both MCP and HTTP servers experienced total MCP tool failure.

User feedback: "this worked before without any flaws"

Root Causes

  1. Connection Timeout Misconfiguration (sqlite_vec.py:329)

    • Used default 5-second timeout, then tried to apply PRAGMA busy_timeout=15000
    • SQLite only respects timeout passed to connect(), ignores pragma applied afterward
    • MCP server timed out before it could set the higher timeout
  2. Concurrent DDL Operations (sqlite_vec.py:467-476)

    • Both servers attempted CREATE TABLE, CREATE INDEX simultaneously
    • Even with WAL mode, DDL requires brief exclusive locks
    • No detection of already-initialized database before running DDL

Fixes

Fix #1: Parse timeout from environment BEFORE opening connection (lines 291-326)

  • Extract busy_timeout from MCP_MEMORY_SQLITE_PRAGMAS environment variable
  • Convert from milliseconds to seconds (15000ms → 15.0s)
  • Pass to sqlite3.connect(path, timeout=15.0) for immediate effect
  • Allows MCP server to wait up to 15 seconds for HTTP server

Fix #2: Detect initialized database and skip DDL (lines 355-373)

  • Check if memories and memory_embeddings tables exist after loading extension
  • If tables exist, just load embedding model and mark as initialized
  • Prevents "database is locked" errors from concurrent CREATE TABLE/INDEX

Test Validation

✅ MCP health check: healthy with 1857 memories while HTTP server running
✅ Log evidence: "Database already initialized by another process, skipping DDL operations"
✅ Restored pre-v8.9.0 concurrent access behavior

Affected Versions

  • Bug introduced: v8.9.0 (database lock prevention pragmas)
  • Fixed in: v8.13.1

Files Changed

  • src/mcp_memory_service/__init__.py (version bump)
  • pyproject.toml (version bump)
  • uv.lock (dependency update)
  • CHANGELOG.md (release notes)
  • src/mcp_memory_service/storage/sqlite_vec.py (concurrent access fixes)

For full details, see CHANGELOG.md

🤖 Generated with Claude Code

Don't miss a new mcp-memory-service release

NewReleases is sending notifications on new releases.