Repository navigation
Replies: 1 comment
|
WAL is safe here and needs no code change, but expect far fewer errors, not zero. You found most of the pieces (links are to
Workaround, per daemon. You need the sqlite3 CLI (
Then restart the daemons. WAL caveats:
Proper fixes. I couldn't find an existing report of this; #3018 is the closest. I can't speak for plans, but it already proposes batching output writes (§5) and fixing the board rebuild (§4). Not covered there:
Your lock counts and logs would be useful on #3018 or a new issue. |
Uh oh!
There was an error while loading. Please reload this page.
Hi Affaan,
First of all, thanks for building and maintaining ECC. I'm really enjoying using it.
I'm running three independent ECC2 daemons on Ubuntu, each with its own configuration directory and SQLite database. Each daemon runs 1–2 Claude Code sessions, along with scheduled tasks (picker every 10 minutes, merge check hourly, and reports every 4 hours).
However, I'm repeatedly encountering database is locked errors during normal usage.
The errors appear in different parts of the daemon:
Worktree auto-prune
Scheduled task dispatch
Session checks
Session runner startup
Session output persistence
Over the last 24 hours, I've recorded 14 lock events across the three daemons, including 12 failed runner starts in a single morning.
Some sessions get stuck in pending state without ever starting a process. I've also experienced skipped scheduled tasks and lost session output.
I investigated the source code and noticed a few potential contributing factors:
SQLite uses a 5-second busy_timeout, with no explicit WAL journal mode configuration.
StateStore::open() appears to execute schema initialization and an INSERT OR IGNORE on every invocation, including CLI invocations.
append_output_line() performs multiple database writes for every output line.
Transient database lock errors appear to propagate without retry in some critical paths.
I also tried increasing heartbeat_interval_secs from 30 to 120, but it didn't make any noticeable difference.
My questions are:
Have you encountered this issue before?
Is there a recommended configuration or workaround to prevent SQLite locking?
Would enabling WAL mode be a safe and recommended approach for ECC2?
Are there any plans to improve SQLite concurrency handling in ECC2?
I haven't modified the source code or database settings locally. I'd be happy to provide logs and help test potential fixes.
Thanks in advance for your help!
All reactions