Repository navigation
fix(engine): a render starts when an image, dialog or font never answers - #9151
Conversation
Edit accuracy: accurate 286 (base branch 286), smooth 75 of thoseThe gate passes. Quarantined, measured but not gated (0) |
|
The description above is for the first head, 3cc6e7f. At 6201f54, read this instead: the dialog part is gone (#9152) and the limit is 45 s, not 15 s. WhatThree waits between opening a page and its first frame had no limit of their own, so a page that never answered one held the render, with the browser idle, until the 300 s protocol limit ended it. Each now ends on its own:
A shorter player-ready timeout shortens the image and font limits. WhyOne broken image, dialog or font face cost a person five minutes and the whole render. The error named a browser call, not the thing that was stuck. Related work#9147 also changes How
A behaviour change: fonts or images that need more than 15 s used to be waited for, up to the protocol limit. They are now captured as they stand, with the warning. Test plan
Not exercised: macOS, Windows, a hardware GPU, and distributed chunk rendering. The decode that never answers is forced by a script in the test page; eleven unusual real images (animated, truncated, very large, swapped while loading) all decoded on Linux, so no natural cause is claimed. Two waits on |
|
This replaces the description and my earlier comment, for head 1154b22. What it does now. A font or picture that has not settled by the page's ready limit ( What changes for a film that renders today. Under 45 s, nothing: a font arriving after 20 s gives frames identical to before. A font or image that needs 45 to 300 s used to be waited for; its render now fails, named. One that never settles used to fail at 300 s with a browser call's name.
Tests. Rendered, CLI built from this head's sources, Linux: a font answered after 20 s, as Not exercised: macOS, Windows, a hardware GPU, distributed chunks, a render that skips the probe. |
|
Correction to the description above: it describes an earlier version of this change. What the diff does at 6776f07:
main is merged in. Locally at that head, the 44 frame-capture test files (465 tests) and the new |
jrusso1020
left a comment
There was a problem hiding this comment.
Approve at 6776f07.
The PR description is older than the diff, so I judged the change against your comment of 1154b22 ("With main's frameCapture.ts the four stop-and-name tests fail") and the correction comment for this head. Since 1154b22 the only commit is a merge of main. git show --remerge-diff is empty, so no conflict was resolved by hand, and the PR's own hunks and pageOpenWaits.browser.test.ts are unchanged since then. That makes the earlier fails-without line apply to this head.
The limit. It is playerReadyTimeout, 45 s by default and settable with PRODUCER_PLAYER_READY_TIMEOUT_MS. Images and videos that are still loading already get this same limit. The font wait starts when the image and video waits start, which is after pollHfReady and the sub-timeline wait, so a font has been loading for longer than 45 s by the time it can be stopped. The decode wait gets its own 45 s, starting after pollImagesReady, so a slow load does not eat into it. The limits are timed in Node (settlesWithin). On a busy machine a Node timer fires late, never early, so a slow asset that is otherwise fine gets at least the full limit. The 5 s asks that name the missing item are timed the same way, so a page that has stopped answering still ends.
Error class. classifyCaptureFailure has no pattern that matches "didn't load", so the error is classed unknown, the same as ImageMissingFromFrameError. On main the same render ended as a protocol_timeout 300 s in. Two things follow from unknown:
isFatalCaptureFailureis true, so the pool stops at once.- The error is not in the distributed non-retryable lists, so a chunk is retried at step level. That matches what you intended.
A font host that never answers is a problem with the network or the host, and a missing file fails fast, so a content kind would not fit either. Nit: a named kind, or an authoring pattern for the font and picture case, would keep these out of the unknown bucket on dashboards. It does not block.
Smaller notes, not blocking
- When the page stops answering,
decodeAllImagesreturns[""], and the error becomes "A picture didn't load". A page that is hung, for example by a script loop, would be reported as a missing picture. That is still better than the 300 s browser-call error, but the wording is a guess there. - In the CLI's single-frame capture, that same
[""]case prints the unloaded-images warning with an empty source list.
Need ✓ (a render waiting 300 s for one asset that never answers) · Size ✓ · Reuse ✓ (the existing ready limit, and the same stop-and-name shape as ImageMissingFromFrameError) · Simpler ✓ · Structure ✓
Risk: a font or image that takes 45 to 300 s used to render and now fails, with its name in the error. That is the trade the PR describes.
Review by Rames
What
Three waits between opening a page and its first frame had no limit of their own, so a page that never answered one held the render, with the browser idle, until the 300 s protocol limit ended it. Each now ends on its own:
decodeAllImageswaits at most 15 s, as background images already do. An image still decoding is named in amedia_readiness_timeoutwarning and the render goes on.alert,confirmorprompt, and an open dialog blocks every call to its page. They are now declined. A page asking to stay (beforeunload) is left.document.fonts.readyis waited on for at most 15 s; then the render goes on with the fonts it has, with a warning.A shorter player-ready timeout shortens the image and font limits.
Why
One broken image, dialog or font face cost a person five minutes and the whole render. The error named a browser call, not the thing that was stuck.
Related work
#9147 also changes
frameCapture.ts. Its hunk does not overlap this change; whichever lands second merges main. No issue.How
settlesWithin), not by a page timer, because the page's own timers stop between frames under BeginFrame.answerPageDialogsis one function: the engine attaches it to the two pages that load a film (the capture session and the static verification page), the CLI to every page oflaunchManagedBrowser. The other engine pages load only our own HTML.recordBackgroundDecodeTimeoutsand the image warning share one recorder.--no-best-effortthese warnings fail the render, as the other readiness warnings do.A behaviour change: fonts or images that need more than 15 s used to be waited for, up to the protocol limit. They are now captured as they stand, with the warning.
Test plan
pageOpenWaits.browser.test.ts(engine, 6 tests) andlaunch.dialogs.browser.test.ts(CLI, 4), both in real Chrome.Runtime.callFunctionOn timed out), the alert, confirm and prompt films, fonts (Runtime.evaluate timed out), and all 4 CLI tests.src/browser,src/captureand thevalidate,layout,motionShotandsnapshottests: 1498 passed, 138 skipped, 1 failed. The failure,snapshotHdrFrame.test.ts, is a colour value (24 off, 8 allowed) and fails the same on this machine with main'slaunch.tsandframeCapture.ts.Not exercised: macOS, Windows, a hardware GPU, and distributed chunk rendering. The decode that never answers is forced by a script in the test page; eleven unusual real images (animated, truncated, very large, swapped while loading) all decoded on Linux, so no natural cause is claimed. Two waits on
decode()keep no limit of their own:applyVideoMetadataHints(an inline SVG poster) and the late-image wait before a frame.