Repository navigation
fix(link): a combo-routed Remote Link turn reads its upstream only as its client drains - #8837
Conversation
… its client drains A combo runs each target on a fresh child log context, so linkTurnPacesReads never saw the parent's link-turn observer and the child kept the 32 MiB inspection read-ahead. The combo now binds each child context to that observer for pacing only; the terminal notice still fires once, from the parent's final log. The structure doc's pacing claim is corrected, and its investigation history moves to the link WebSocket gate-opening devlog unit. Addresses PRRT_kwDOS-0Gi863w6KX and PRRT_kwDOS-0Gi863w6Ke on #8785.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
✅ Deterministic PR hygiene checks passed. |
|
Maintainer integration of #8837 at 767c125. It fixes CodeRabbit threads PRRT_kwDOS-0Gi863w6KX and w6Ke, left on #8785.
|
Summary
A Remote Link turn routed through a combo still let the Home read up to 32 MiB ahead of a stalled Child. #8785 paced every relayed link turn, but the pacing check (
linkTurnPacesReads) looks up the link-turn observer by log context, and a combo runs each target on a fresh child log context that was never bound to it. A Child that stopped reading a combo-routed turn therefore held about 37 upstream chunks on the Home instead of one.The combo now binds each child's log context to the parent's link-turn observer for pacing only (
bindLinkTurnChildinsrc/server/link-turn.ts, called wherecore-combo.tsbuilds the child log). The binding lives in a separate map thatnotifyLinkTurnFinalnever reads, so the observer's terminal notice still fires once, from the combo's own final log.Docs:
structure/remote-link.mdno longer claims that every link turn is paced without qualification. It now names the passthrough relay as the paced path, describes combo children and the stream preflight's first chunk, and points to the regression test. The investigation history and recorded RSS runs moved out of that structure doc intodevlog/_plan/261113_link_websocket_gate_opening/010_memory_investigation.md.structure/transports/byte-accounting.mdnames combo targets. No en/es docs-site page describes link read pacing, so none changed.Addresses CodeRabbit review threads PRRT_kwDOS-0Gi863w6KX and PRRT_kwDOS-0Gi863w6Ke on #8785.
Verification
Regression tests in
tests/responses/stalled-reader-memory.test.ts:Expected: <= 2, Received: 37upstream chunks before the client's first read. With the fix: passes. After the first read the reader stays one chunk ahead; before it, the combo stream preflight also holds the chunk it read to commit the target.bindLinkTurnChilddoes not exist (SyntaxError on import). With the fix: passes. A child's final log fires nothing, and the parent's fires exactly once.Commands, each focused file run under
/usr/bin/lockf -k /tmp/ocx-test.lockbecause the host is under heavy load:bun test tests/responses/stalled-reader-memory.test.ts: 13 pass, 0 failbun test tests/server/link-request-log-fields.test.ts: 16 pass, 0 failbun test tests/server/link-websocket-upgrade.test.ts: 21 pass, 0 failbun test tests/server/link-websocket-holds.test.ts: 19 pass, 0 failbun run typecheck,bun run structure:check,bun run privacy:scan: all passNOT RUN: full
bun run testandbun run test:changed(the host is under heavy load and the task limited local runs to focused files;ci:fullcovers the rest), and the opt-in RSS acceptancetests/e2e-style/link-websocket-rss.test.ts.Checklist
Summary by CodeRabbit