Skip to content

perf(onlion): the search must outrun the harness client; the fold stops stalling on the provider - #133

Merged
wefio merged 2 commits into
mainfrom
perf/stabilisation-round
Oct 30, 2026
Merged

wefio merged 2 commits into
mainfrom
perf/stabilisation-round

Conversation

@wefio

@wefio wefio commented Oct 30, 2026

Copy link
Copy Markdown
Owner

What

  • Doc owner: `docs/decisions/implemented/2026-10-30-stabilisation-round.{md,zh-CN.md,terms.yaml}` — four live failures (15:26 /search 503 in 4.2 s; 15:31 SEARCH_TIMEOUT 504; dependency_timeout ×9 @25 s; 120 s kills @914/907 MB), each mapped to one fix:
    1. search catches `snapshot_changed` → re-read manifest, retry ×2 (the read-path round retired the CAS retry that used to cover this race).
    2. `SEARCH_DEADLINE_MS` 60 s → 25 s — a partial answer must land inside the harness client window (their docs publish no figure; 504 at 15:31 is the proof it must).
    3. `EMBED_DOCUMENT_TIMEOUT_MS` 25 s → 12 s, and document chunks sequential by default (`NMG_EMBED_CHUNK_CONCURRENCY=1`; fold 32 = three 10-row calls, not three racing 25 s stalls holding the manifest CAS).
    4. `nmg_request` gains `execution: waituntil|inline` — the 14:41 deploy shipped a stale entry chunk and could only be caught after 40 min of misreading; this makes it one grep.

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).

wefio added 2 commits October 30, 2026 15:46
… 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.
@wefio
wefio merged commit cd3255b into main Oct 30, 2026
8 checks passed
@wefio
wefio deleted the perf/stabilisation-round branch October 30, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant