Skip to content

Bug: embedded Kanban dispatcher still leaks sqlite/WAL file descriptors after #28301 #29610

@wyjuven

Description

@wyjuven

Summary

Even with the #28301 fix present, the gateway-embedded Kanban dispatcher still appears to leak file descriptors on successful board ticks.

This seems different from #28285:

  • #28285 / #28301 fixed the case where kanban_db.connect() raised during initialization and the connection was never closed.
  • This remaining issue shows steady fd growth without requiring an init failure on each tick.
  • The leaked descriptors are mainly repeated kanban.db and kanban.db-wal handles.

Environment

  • Hermes Agent 0.14.0
  • Reproduced on current main
  • Linux
  • Gateway running as services

Minimal repro

Leave exactly one profile with:

kanban:
  dispatch_in_gateway: true
  dispatch_interval_seconds: 60

Set other profiles to:

kanban:
  dispatch_in_gateway: false

Restart gateways, then sample fd count on the sole dispatcher host once per minute.

Observed behavior

Example fd samples:

t+0m  212
t+1m  224
t+2m  236
t+3m  248
t+4m  260
t+5m  272

This is a stable +12 fd / minute slope.

The repeated fd targets are mainly:

  • kanban.db
  • per-board kanban.db
  • matching kanban.db-wal

Expected behavior

With only one embedded dispatcher host, fd count should stay roughly stable.

Actual behavior

The sole dispatcher host keeps accumulating kanban.db / kanban.db-wal descriptors every dispatch interval until it eventually hits fd exhaustion.

Failure symptoms after enough accumulation

sqlite3.OperationalError: unable to open database file
[Errno 24] Too many open files
Channel directory: failed to write: [Errno 24] Too many open files
Failed to send message: Cannot connect to host ... [Too many open files]

Temporary workaround

Disable embedded dispatch:

kanban:
  dispatch_in_gateway: false

This is the only reliable mitigation found so far.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/gatewayGateway runner, session dispatch, deliverycomp/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