Skip to content

feat(kanban): add busy_timeout PRAGMA to prevent WAL corruption under concurrent writers #32532

@Danuselli

Description

@Danuselli

Summary

kanban_db.py initializes SQLite with WAL journal mode and synchronous=NORMAL, but does NOT set busy_timeout. When two processes (Gateway Dispatcher + Dashboard Plugin) attempt simultaneous writes, SQLite returns SQLITE_BUSY instead of waiting. This causes WAL journal corruption.

One-line fix verified stable over 12+ hours:

conn.execute("PRAGMA busy_timeout=10000")

Environment

  • Hermes Agent v0.14.0 (2026.5.16) on Ubuntu 24.04
  • 6 active Hermes profiles, Kanban with 30+ tasks
  • Gateway dispatcher + Dashboard Kanban plugin concurrently

Steps to Reproduce

  1. hermes kanban with dispatch_in_gateway: true, 30+ tasks
  2. hermes dashboard --tui concurrently
  3. Wait 10-30 min
  4. hermes kanban list → database disk image is malformed

Root Cause

kanban_db.py line 1182-1185 sets WAL + synchronous but no busy_timeout. Concurrent writes get immediate SQLITE_BUSY, abort mid-transaction, corrupting WAL file.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/pluginsPlugin system and bundled pluginstype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions