Skip to content

Investigate why agent-relay brokers end up SIGSTOP'd holding the SQLite write lock #50

Description

@khaliqgant

Problem

Two agent-relay processes were found in state T/Ts (stopped), one having been suspended since Jul 30 and the other since Aug 1:

PID    STARTED                  ELAPSED       STAT  COMMAND
13214  Thu Jul 30 21:48:37      03-10:55:06   T     agent-relay node up
85652  Sat Aug  1 19:22:19      01-13:21:24   Ts    agent-relay node up

One was frozen mid-write-transaction, so it held the SQLite write lock permanently. ai-history.db and its WAL were frozen at Aug 2 21:37, and every ai-hist sync failed with database is locked in 0s for days.

Questions

  • What suspends these processes? SIGSTOP from a supervisor/watchdog, Ctrl-Z from an interactive shell, a debugger attach, or macOS App Nap / process throttling?
  • Why do two long-lived brokers hold the database open continuously at all, rather than opening for the duration of a write and closing?
  • Should the broker hold a write transaction across any operation that can block?

Mitigations regardless of cause

Note the resolution is to resume these processes, not stop them — they are already stopped, and resuming lets the stuck transaction finish and release the lock.

Related: #46, #47

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions