Repository navigation
Commit e4701dd
authored
GH#17549: fix concurrent worker deaths — DB archival + dispatch stagger (#17582)
Root cause: OpenCode's session DB (11.4 GB, 1.86M parts) uses
busy_timeout=0. When 8+ workers write simultaneously, SQLITE_BUSY
kills sessions silently mid-turn. Affects both Anthropic and OpenAI.
Two fixes:
1. opencode-db-archive.sh: Archives sessions >14 days to a separate
archive DB, keeping the active DB small for reduced write contention.
Processes in batches of 500 with a time budget (--max-duration-seconds)
for pulse pre-flight integration. Protects active worker sessions.
2. Dispatch stagger: Increases inter-dispatch delay from 2s to 8s
(PULSE_DISPATCH_STAGGER_SECONDS) so workers don't all hit the DB
at the same instant. Configurable via env var.
Upstream issue filed: anomalyco/opencode#21215 (busy_timeout=0)1 parent b1b15e5 commit e4701dd
2 files changed
Lines changed: 608 additions & 1 deletion
0 commit comments