Repository navigation
Serve the live view connect bounds instead of compiling them in - #472
robertjamesprior wants to merge 1 commit into
Conversation
Sayan-
left a comment
There was a problem hiding this comment.
rather than tuning this timeout internally the change in this PR should be the plumbing required to accept this as an env var we can control externally (e.g. as we add more regions or data for timeouts, etc changes)
36a10b2 to
e94d47c
Compare
|
moved the value out of the client. it reads window.KERNEL_LIVE_VIEW_CONNECT_TIMEOUTS_MS at load and falls back to the image defaults, and metro-api injects it per region from KERNEL_LIVE_VIEW_CONNECT_TIMEOUTS (kernel/kernel#4889, kernel/infra#1693). no image release to retune. is metro-api the surface you meant, or did you want the api appending it to the live view url? |
Sayan-
left a comment
There was a problem hiding this comment.
overall looks good, and the external timeout config is what i was asking for. can we keep the default media timeout at 30s for now? the 10s default hasn't been validated across regions; 44 of 130 probes never recorded connected, including all 30 ap-southeast runs.
The per-stage bounds added in #417 run in sequence, so they sum to a budget an embedder has to outlast to see why a viewer stalled, and tuning them in the client means every adjustment, and every new region, waits on a browser image release. The bounds are read at load from window.KERNEL_LIVE_VIEW_CONNECT_TIMEOUTS_MS, which the live-view proxy serves with the page from its own environment. A stage the proxy does not name, or names with a value that is not a positive number of milliseconds, keeps the default the image ships, so the client behaves the same on a proxy that injects nothing. The defaults are unchanged: transport 15s, signaling 3s, media 30s. The media bound stays at its interim ceiling because the stretch through ICE `connected` is unmeasured in every region — 44 of 130 probe runs stopped at `checking`, all 30 ap-southeast runs among them — and the override is what a region with the timings uses to lower it. A test pins the shipped defaults so a silent change fails CI. `bun test tests`: 235 pass, 0 fail. `tsc --noEmit` clean.
e94d47c to
4a1031d
Compare
|
yeah, that makes sense. put the media default back at 30s and the override is the only path to a shorter one and a region changes it with its own timings. |
Summary
The per-stage connect bounds the live view client arms while connecting are now served with the page instead of compiled into the bundle, so a region can retune one without a browser image release. This follows review feedback on the earlier revision of this branch, which shortened the media bound in the client.
The bounds are read at load from window.KERNEL_LIVE_VIEW_CONNECT_TIMEOUTS_MS, which the live-view proxy injects ahead of the first script in the page from its own environment (kernel/kernel#4889, kernel/infra#1693). A stage the proxy does not name, or names with a value that is not a positive number of milliseconds, keeps the default the image ships, so the client behaves the same on a proxy that injects nothing.
The defaults stay transport 15s, signaling 3s and media 30s, a worst case of 48s across the three, and a test pins them so a silent change fails CI.
Why the media default stays at 30s
The bound covers the connect through ICE
connected, and that stretch is unmeasured in every region: 44 of the 130 probe runs stopped atchecking, all 30 ap-southeast runs among them. The measured paths land in 1-16ms direct and ~90ms relay-only, which is what made a shorter default tempting, but an expired bound is terminal and the client does not retry, so the default stays at the ceiling the data supports rather than the shortest value that fits the measured regions. A region with the timings lowers it through the override.Transport stays at 15s: the live-view proxy can spend ~12s waking a browser before the socket opens, so shortening it would report a slow wake as dead.
Testing
bun test testsin images/chromium-headful/client, 235 pass, 0 fail, including cases for a partial override, values that are not positive milliseconds, an unknown stage, and the shipped defaults being the documented 15 / 3 / 30.tsc --noEmitclean.Related
browsers/live-view.mdx moves with this in kernel/docs#704: the example watchdog goes from 15s to 50s, above the 48s budget, and the sentence claiming KERNEL_CONNECTION_TIMEOUT stops firing once negotiation begins, which describes the pre-kernel-images#417 client, is corrected.