You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(api): address review on stream-replay hardening
- CRITICAL (gemini): break the scroll loop on an empty hits page. Relying solely on
counter === total could loop forever scrolling empty pages (deletes/merges mid-scroll, or a
capped total counter never reaches) — pegging CPU and spamming ES.
- Track total hits to (cap + 1) on the replay query (codex): ES only tracks 10k by default, so
a 60k-doc replay would slip a 50k cap and silently truncate at 10k. Now the cap is enforced
accurately and replays stream to their true end.
- Return a failure status on client disconnect (copilot): previously returned status:true, so
the caller launched up to 3 follow-up 'fill' replays scrolling the cold tier for a dead socket.
- Normalize stream_max_concurrent_replays against NaN/negative (copilot) so a bad config can't
silently disable the cap.
hLog(`[WARN][${requestUUID}] Unbounded ${dataKind} replay of ${totalHits} docs (api.stream_scroll_limit=-1) — set a finite limit to protect old/cold indices.`);
239
+
hLog(`[WARN][${requestUUID}] Unbounded ${dataKind} replay of ${totalHits}+ docs (api.stream_scroll_limit=-1) — set a finite limit to protect old/cold indices.`);
0 commit comments