fix(serve): HTTP ingest visibility + start embed daemon - #44
Open
eSlider wants to merge 1 commit into
Open
Conversation
Deployment benchmark (Phase 5 verify) surfaced two real bugs: 1. HTTP /ingest wrote facts through its own connection, but Ladybug WAL snapshots the serve read connection at first query — ingested leafs were invisible to /search, /get and /stats until the process restarted. Fix: close the writable connection (commit), then reopen the serve read connection (refreshBrain). 2. embedQuery tries a search daemon on KBSEARCH_PORT (17830) that was never started in the api image. Every query spawned a doomed subprocess and polled 10s before falling back to a per-query model load: ~12s per search. Fix: docker-entrypoint serve starts /usr/local/bin/brain-search serve <port> in the background before exec brain-serve. Search latency drops 12.4s -> ~25ms. Verified on a clean DB: ingest facts D/E visible immediately (stats facts:2 without restart), /get + /search return them, recall@5 = 1.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deployment benchmark found + fixed two real bugs (see commit).\n\n1. HTTP /ingest invisible without restart: Ladybug WAL snapshots the serve read connection; ingested leafs stayed hidden from /search, /get, /stats. Fixed by closing the writable conn then reopening the serve read conn (refreshBrain).\n2. ~12s search latency: embedQuery polls for an embed daemon on :17830 that the api image never started — every query spawned a doomed subprocess + 10s poll, then a per-query model load. Fixed by starting
brain-search servein the entrypoint. Latency 12.4s → ~25ms.\n\nVerified on clean DB: ingest facts visible immediately (no restart), /get + /search return them, recall@5 = 1.0.