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
{{ message }}
Repository navigation
tower tunnel: small RPCs starve behind large transfers on the shared H2 session (default 64 KB windows) — 39 s explorer stall through the relay #1677
Field measurement from the fork's web-IDE interim path (browser in Sydney → cloud.codevos.ai on Railway sin1 → tunnel → Tower/IDE server on a Sydney WSL box), 2026-09-12. Chrome performance trace + HAR analysed.
Symptom
A tiny RPC on the VS Code management WebSocket (explorer root resolve, ~100 B request / ~3 KB reply) took 39 s (sent 12.96 s, answered 52.11 s). A terminal getTerminalLayoutInfo on the same socket took 15 s. Page main thread idle; socket connected; no HTTP in flight. Replies on that socket arrived as a trickle of ~0.5–1.5 KB/s for ~40 s.
Concurrently the browser pushed 1.3 MB on the extension-host WebSocket at 19 s (the extension registry), then 199 KB at 26 s and 146 KB at 46 s. The small replies stalled until those drained.
Ruled out: the client machine (measured 2.5 MB/s upload to the Cloudflare edge, RTT 7 ms; origin TTFB 195 ms) and the IDE server (server-side trace shows extension scan, ext-host spawn and folder watchers all done within ~1 s of connection).
Hypothesis
Both browser WebSockets are proxied (RFC 8441 CONNECT) as two streams on one H2 session between the relay and the tower. Neither end sets H2 window sizes: http2.connect(...) on the relay and http2.createServer({ settings: { enableConnectProtocol: true } }) on the tower both run with Node's defaults (64 KB initial/session window, no setLocalWindowSize). With a ~100–150 ms relay↔tower RTT, a 64 KB shared window caps the session and lets a large transfer on one stream starve small frames on the other (head-of-line blocking at the session window). The observed shape matches.
Ask
Measure tunnel throughput per direction and RTT relay↔tower on a real tower (a 2 MB upload and download through /t/<tower>/...).
Raise H2 windows on both ends: settings.initialWindowSize (per stream) to ≥1 MB and call session.setLocalWindowSize(...) for the connection window on both the relay's client session and the tower's server session; consider paddingStrategy/maxSessionMemory accordingly. Also check wsperMessageDeflate on the tower's tunnel client (default on for ws clients) — CPU-bound inflate of large DATA frames in the same event loop delays outbound frames.
Re-test: the acceptance signal is a small management RPC completing in ~1 RTT while a 1 MB message is in flight on the other stream.
This directly affects the durable design (Tower-owned /ide/ forward): the IDE's two sockets will always share the tunnel.
Routing ruling from the tower contract seat: (1) This is a COMPANION fix to #1668, not a plan change — the forward proxies to loopback and owns no H2 tuning; the starvation lives in the tunnel-client↔relay session. #1668 proceeds unchanged. (2) It IS a binding SEQUENCING input for #1668's cloud-leg verification: a ~21MB workbench boot through two streams on an untuned 64KB-window session would crawl, and a slow cloud leg would misattribute tunnel starvation to the forward — so the cloud-leg judgment waits for this fix or explicitly accounts for it. (3) Severity note: the measured 15s terminal RPC under a 1.3MB drain means every cloud-relay user's terminals hit this today, independent of the IDE — promoting this to the 3.3.4 candidate set alongside #1629/#1627. The measurement-first ask (per-direction throughput before tuning) is the right order.
Bisection confirmed (owner test, 2026-09-12). Same IDE server, same folder, same browser session, opened directly at the server (LAN, no relay/tunnel): explorer and sidebar populate instantly. Through the relay: ~45 s. That clears the server, the build and the client machine; the stall is entirely in the relay↔tower path.
Reopened per the gate ruling (Refs, not Fixes): PR #1678 delivered the TOWER-SIDE inbound half only. GitHub auto-closed this on merge because the ruling was applied to the PR body but commit messages ('Fix #1677: ...') also carry auto-close keywords — noted as a process gotcha for future Refs rulings (amend must cover commits or the ruling needs a reopen like this one). Still outstanding before this issue closes: relay-side deploy live (codev-cloud 33b9781, was deploying), and the end-to-end field re-test of the 100B-RPC-under-1.3MB-drain scenario with both halves live. The re-test also unblocks judging #1668's cloud leg.
Field re-test with both halves live (2026-09-19). Relay on 33b9781 (1 MiB stream / 4 MiB session), tower on codev 3.3.4 (this fix via #1678) forwarding a full browser IDE through /t/<tower>/ide/ (#1683), WSL tower, Windows browser, real repository open:
before (64 KiB defaults)
after
IDE explorer populates (management-socket RPCs behind a ~1.3 MB ext-host push)
45–52 s
7 s
IDE integrated terminal usable
~15 s
12 s
Direct-on-localhost reference for the same session: < 1 s. The head-of-line starvation is gone; what remains is relay round-trips plus remote extension-host spawn. codev-cloud's synthetic before/after throughput run (big asset vs concurrent small request) is queued on their side as the second data set.
Closing on the 2026-09-19 field re-test above: both halves live (tower 3.3.4 via PR #1678, relay deployed), and the head-of-line starvation this issue is about is gone end to end (explorer RPCs behind a 1.3 MB drain: 45-52 s before, 7 s after). The residual integrated-terminal latency (12 s vs < 1 s localhost) barely moved with the window fix, so it is a different bottleneck and now tracked separately as #1708 (attribute the terminal channel leg by leg, fix the codev-side share).
Activity
amrmelsayed commentedon Sep 12, 2026
Routing ruling from the tower contract seat: (1) This is a COMPANION fix to #1668, not a plan change — the forward proxies to loopback and owns no H2 tuning; the starvation lives in the tunnel-client↔relay session. #1668 proceeds unchanged. (2) It IS a binding SEQUENCING input for #1668's cloud-leg verification: a ~21MB workbench boot through two streams on an untuned 64KB-window session would crawl, and a slow cloud leg would misattribute tunnel starvation to the forward — so the cloud-leg judgment waits for this fix or explicitly accounts for it. (3) Severity note: the measured 15s terminal RPC under a 1.3MB drain means every cloud-relay user's terminals hit this today, independent of the IDE — promoting this to the 3.3.4 candidate set alongside #1629/#1627. The measurement-first ask (per-direction throughput before tuning) is the right order.
amrmelsayed commentedon Sep 12, 2026
Bisection confirmed (owner test, 2026-09-12). Same IDE server, same folder, same browser session, opened directly at the server (LAN, no relay/tunnel): explorer and sidebar populate instantly. Through the relay: ~45 s. That clears the server, the build and the client machine; the stall is entirely in the relay↔tower path.
amrmelsayed commentedon Sep 12, 2026
On it! Working on a fix now.
Fix #1677: raise tunnel H2 flow-control windows and disable ws deflate
Fix #1677: address CMAP review — settle guard, deflate comment, dedup…
[Bugfix #1677] Thread: PR #1678 up, 3-way CMAP all APPROVE, pr gate p…
[Bugfix #1677] Thread: PR body Fixes->Refs #1677 per gate decision; h…
Fix #1677: document perMessageDeflate as a verified guard, not an act…
[Bugfix #1677] Thread: relay half shipped (codev-cloud 33b9781); fiel…
[Bugfix #1677] Thread: pr gate approved (Amr via main); holding for m…
amrmelsayed commentedon Sep 14, 2026
Reopened per the gate ruling (Refs, not Fixes): PR #1678 delivered the TOWER-SIDE inbound half only. GitHub auto-closed this on merge because the ruling was applied to the PR body but commit messages ('Fix #1677: ...') also carry auto-close keywords — noted as a process gotcha for future Refs rulings (amend must cover commits or the ruling needs a reopen like this one). Still outstanding before this issue closes: relay-side deploy live (codev-cloud 33b9781, was deploying), and the end-to-end field re-test of the 100B-RPC-under-1.3MB-drain scenario with both halves live. The re-test also unblocks judging #1668's cloud leg.
[Bugfix #1677] Thread: PR merged (678f082); lesson — Refs ruling must…
[PIR #1668] Thread: dev-approval caveat + #1677 cloud-leg dependency
Merge pull request cluesmith#1678 from cluesmith/builder/bugfix-1677
amrmelsayed commentedon Sep 19, 2026
Field re-test with both halves live (2026-09-19). Relay on 33b9781 (1 MiB stream / 4 MiB session), tower on codev 3.3.4 (this fix via #1678) forwarding a full browser IDE through
/t/<tower>/ide/(#1683), WSL tower, Windows browser, real repository open:Direct-on-localhost reference for the same session: < 1 s. The head-of-line starvation is gone; what remains is relay round-trips plus remote extension-host spawn. codev-cloud's synthetic before/after throughput run (big asset vs concurrent small request) is queued on their side as the second data set.
amrmelsayed commentedon Sep 19, 2026
Closing on the 2026-09-19 field re-test above: both halves live (tower 3.3.4 via PR #1678, relay deployed), and the head-of-line starvation this issue is about is gone end to end (explorer RPCs behind a 1.3 MB drain: 45-52 s before, 7 s after). The residual integrated-terminal latency (12 s vs < 1 s localhost) barely moved with the window fix, so it is a different bottleneck and now tracked separately as #1708 (attribute the terminal channel leg by leg, fix the codev-side share).