brainbar_hybrid_helper wedges to 100% of a core every ~15-20 min; the wedging query is still unidentified
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python, sqlite
- Domain
- backend, databases, performance
Research direction
Read src/brainlayer/mcp/search_repo.py around lines 2117 and 2263-2266, then use the sampling evidence and PR #735's deadline behavior to trace which request reaches the unbounded SQLite path. Done means the wedging statement is identified with evidence, bounded or made index-satisfiable without silently dropping results, and the helper survives 24 hours of normal fleet traffic without a 100%-core episode.
Written by the indexing model from the issue text.
Description
Problem
brainbar_hybrid_helper wedges to 100% of one core and stays there until killed. Observed three
times on 2026-08-24 alone: 19:04, 19:20, 20:14 — roughly every 15–20 minutes, unprompted. The
first instance had burned 46m12s of CPU across ~7h of life.
Evidence it is a wedge, not load
SIGTERM the wedged process and BrainBar respawns it against the same DB and the same client
traffic — the replacement measures 0% CPU. Same code, same load, 100% → 0%. A loaded process
would not do that.
sample <pid> 5 puts 4150/4150 busy-thread samples in sqlite3_step → sqlite3VdbeExec, dominated
by sqlite3VdbeMemSetText / sqlite3VdbeMemGrow (row-by-row text materialization) plus
sqlite3BtreeIndexMoveto, with no fts5 symbols anywhere in the hot path. That is a scan over
chunks (1.07M rows / 14.8 GB), not an FTS hit or an index seek.
What PR #735 does and does not do
#735 adds a hard request deadline so a wedged query can no longer peg a core indefinitely — it logs
the offending request and recycles the process. That is containment, not a cure. This issue tracks
the remaining work: identify the actual query.
Two real leads (neither proven to be this wedge — do not assume)
src/brainlayer/mcp/search_repo.py:2117—
fts_timeout_ms = _BRAINBAR_HELPER_FTS_BUDGET_MS if brainbar_helper_fast_profile else None.
FTS is bounded only for the BrainBar fast profile; every other caller runs FTS unbounded.search_repo.py:2266— the trigram fetch is the one_fetch_fts_rowscall that passes no
timeout_msat all, while its siblings on:2263/:2265do.
⚠️ Constraint for whoever takes this
_fetch_fts_rows returns [] on timeout. So "just add timeouts everywhere" would silently drop
search results, which BrainLayer forbids. Fix the unboundedness without introducing silent
truncation — #735 deliberately fails loudly for this reason.
Acceptance criteria
- The wedging statement is identified with evidence (not inferred).
- It is bounded or made index-satisfiable without silently truncating results.
- The helper survives 24h under normal fleet traffic with no 100%-core episode.
— brainlayerClaude (lead) · claude-code/claude-opus-5
- Dominant language
- Python
- Stars
- 9
- Forks
- 7
- Avg merge
- 2h 7m
- Merged PRs (30d)
- 237
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
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EtanHey/brainlayer#1040 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EtanHey/brainlayer#1034 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
EtanHey/brainlayer#1032 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
EtanHey/brainlayer#999 · 1 comment ·
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
All issues in EtanHey/brainlayer
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
kornia/kornia#5263 · 1 comment ·
Maintainers usually reply within 1 day
-
approved correction metadata
Difficulty 1/5 Under an hour Newbie friendliness 88/100
acl-org/acl-anthology#10133 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BasedHardware/omi#20084 ·
Maintainers usually reply within 1 day
-
bug needs-acceptance wg/evaluation-quality
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vllm-project/semantic-router#4424 ·
Maintainers usually reply within 1 day