Repository navigation
perf(onlion): the search must outrun the harness client; the fold stops stalling on the provider - #133
Merged
Conversation
… stops stalling on the provider Four live failures from the 15:2x-15:31 burst, each reproducible from the always-on lines: 1. /search 503 in 4.2 s: a fold retired the partition objects between the search's single manifest read and its partition GETs (snapshot_changed had nothing to retry after the read-path round). The search now catches snapshot_changed and re-runs from a fresh manifest read, twice. 2. SEARCH_TIMEOUT 504 from the harness: our 60 s deadline is longer than the client's window, so a partial answer at 60 s scores nothing. Deadline defaults to 25 s (NMG_SEARCH_DEADLINE_MS). 3. dependency_timeout x9, 25 s per document call: the fold's 32-record backfill raced three chunks against one saturated provider account while holding the manifest CAS. Document timeout 25 s -> 12 s, and document chunks are sequential by default (NMG_EMBED_CHUNK_CONCURRENCY, worker default 1) instead of three-wide. 4. 120 s kills at 914/907 MB: stalled chunks held SQLite state for the invocation's clock; removing the stalls shrinks both. Also: the nmg_request line gains execution: waituntil|inline, so a deploy whose zip kept a stale entry chunk (the 14:41 event - dist/ retained stale files) is caught by one grep; the test pin moves with the timeout. Recorded in docs/decisions/implemented/2026-10-30-stabilisation-round.*
… back under the complexity gate
CodeFactor caught the search at complexity 16 after the snapshot_changed retry
was added: the retry, the deadline, and the partition loop all landed in one
function body.
`readSearchCandidates` now owns the per-partition read (deadline, the read-only
service call, the running top-K) and returns { candidates, modes, partial }.
Search keeps the retry loop and the answer assembly. No behaviour change; the
read path is still write-free, and the source pin in test-add-log-mode now
covers the extracted reader so a write reintroduced there still fails.
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.
What
Not verified
Not yet verified against the deployed build (local verify 37 PASS, CI pending). The harness client timeout figure is undocumented; 25 s is chosen to sit inside any plausible window — needs one real run to confirm. The 15:26 503 race is pinned by the retry, not by a dedicated race test (CI covers the retry path through the live-worker suite).