Repository navigation
Replace a hung WebView renderer instead of waiting on it - #47
Merged
Merged
Conversation
A soak run on a TV had the WebView renderer stop painting at 04:12. Every web page after that timed out and was swapped in unpainted, while the renderer grew past 500 MB and pushed the TV into swap until lmkd killed it. When a page misses the paint timeout, run a trivial script in it. A slow page answers; a hung renderer doesn't, so kill it, give both web slots a fresh one and report a PlaybackError for the page. Adds a broken_hung_web sample page that hangs the renderer, the first web state machine tests, and the renderer's RAM plus swap to the soak script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A 16-hour soak run on the TV had the WebView renderer stop painting at 04:12. From then on every
web_timerload missed its paint and was swapped in after the 5-second timeout, while the renderer grew to 113 MB of RAM plus 418 MB of swap. Free memory and swap ran out, the TV's own services were killed and restarted 230 times, and 83 video cuts held for over a second. lmkd killed the renderer at 06:48 and everything recovered. Short loops on the TV didn't reproduce the hang, so the cause inside Chromium is unknown.The library now checks the renderer when a page misses the paint timeout. It runs a one-line script in the page: a slow page still answers, a hung renderer doesn't. With no answer within 3 seconds, it terminates the renderer (Android 10 and later), replaces both WebViews since they share it, and reports
PlaybackErrorfor the page instead of showing it unpainted. The refresh loop does the same. Paint timeout plus check is 8 seconds, inside the controller's default 10-secondreadyTimeoutMs, so a hung page isn't reported as started first.Also in this change:
broken_hung_web, a sample page whose script never returns, to hang the renderer on demand. On the TV the renderer was replaced each time and the next page painted at once on the new one.WebStateMachineTest, the first tests for the web player: a slow page still swaps in, a hung renderer is replaced and reported, and the next page plays on the replacements.