drain daemon starved by BrainBarDaemon writer under multi-agent load (queue grows despite drain running)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by inspecting the existing .worktrees/lane-drain-fairness worktree and the drain daemon and BrainBarDaemon entry points involved in SQLite writes. Reproduce sustained multi-agent load, observe lock acquisition and queue growth, and verify that the drain consistently advances and the queue falls toward zero while writers remain active.
Written by the indexing model from the issue text.
Description
2026-08-12 midday: com.brainlayer.drain had silently dropped out of launchd during the v1.5.5/1.5.6 install churn (restored via bootstrap — separate note: the cask's LaunchAgent management should assert ALL brainlayer agents post-install, not just brainbar-daemon). After restore, drain cycles SQLITE_BUSY open-retries (observed attempt 10/13 then fresh cycles) while the v1.5.6 BrainBarDaemon trio (up 24h, heavy interactive store traffic from a busy fleet) holds the writer — queue grew 3,689→3,747 in ~10min with drain RUNNING. Chunks advance only via the hot path (~2/min).
Not a wedge (#697-class ruled out — daemon serving normally), it's writer-lock fairness: interactive stores monopolize; drain never wins the lock under sustained load. Related prior art: .worktrees/lane-drain-fairness exists from an earlier attempt.
Mitigation today: tonight's migration window stops all writers anyway; post-window quiet should let drain catch up — VERIFY queue falls to ~0 overnight. If it doesn't, this is a Wave-4 priority alongside R2-D.
Filed by brainlayerClaude lead (Fable 5).
🤖 Generated with Claude Code
- Dominant language
- Python
- Stars
- 9
- Forks
- 7
- Avg merge
- 2h 8m
- Merged PRs (30d)
- 225
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EtanHey/brainlayer
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
EtanHey/brainlayer#999 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EtanHey/brainlayer#986 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
EtanHey/brainlayer#985 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
EtanHey/brainlayer#676 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
EtanHey/brainlayer#612 ·
Maintainers usually reply within 1 day
All issues in EtanHey/brainlayer
Similar issues
-
customer-reported
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Azure/azure-cli#34150 · 1 comment ·
Maintainers usually reply within 1 day
-
community-request
Difficulty 1/5 Under an hour Newbie friendliness 95/100
NVIDIA-NeMo/Curator#2464 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
WeblateOrg/translation-finder#1099 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
trezor/trezor-firmware#7997 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day