Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Issue 2281323002: Use exponential backoff for component extension reloads. (Closed)

Created:
4 years, 3 months ago by apacible
Modified:
4 years, 3 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use exponential backoff for component extension reloads. Currently, any force installed extension attempts to reload after 3s. We're currently seeing an uptick in extension process crashes -- please see BUG for details. This is a short term fix, which will mitigate crash loops for component extensions. Any extensions that are policy-enabled will still be reloaded after 3s. We avoid using exponential backoff for policy-installed extensions since this can allow users to kill the extension multiple times, effectively disabling it. This patch adds tracking for BackoffEntry objects corresponding to each component extensions that attempt to reload. The backoff policy values are similar to the extension check update's backoff policy. BUG=639104 Committed: https://crrev.com/fb3b9fae7ff5afefa0275f1c8d30351fbfde81fc Cr-Commit-Position: refs/heads/master@{#415555}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Changes per atwilson@'s comments. #

Total comments: 6

Patch Set 3 : Changes per atwilson@'s comments. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -1 line) Patch
M chrome/browser/background/background_contents_service.h View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/background/background_contents_service.cc View 1 2 2 chunks +37 lines, -1 line 4 comments Download

Messages

Total messages: 50 (36 generated)
apacible
PTAL, thanks!
4 years, 3 months ago (2016-08-27 01:19:42 UTC) #24
Andrew T Wilson (Slow)
https://codereview.chromium.org/2281323002/diff/80001/chrome/browser/background/background_contents_service.cc File chrome/browser/background/background_contents_service.cc (right): https://codereview.chromium.org/2281323002/diff/80001/chrome/browser/background/background_contents_service.cc#newcode540 chrome/browser/background/background_contents_service.cc:540: // If the extension was a non-policy installed, component ...
4 years, 3 months ago (2016-08-29 07:53:47 UTC) #25
apacible
Thanks for your comments! +rdcronin (extensions) to weigh in on the suggestions. https://codereview.chromium.org/2281323002/diff/80001/chrome/browser/background/background_contents_service.cc File chrome/browser/background/background_contents_service.cc ...
4 years, 3 months ago (2016-08-29 16:40:11 UTC) #28
Devlin
On 2016/08/29 16:40:11, apacible wrote: > +rdcronin (extensions) to weigh in on the suggestions. I ...
4 years, 3 months ago (2016-08-29 20:19:28 UTC) #29
Devlin
https://codereview.chromium.org/2281323002/diff/120001/chrome/browser/background/background_contents_service.cc File chrome/browser/background/background_contents_service.cc (right): https://codereview.chromium.org/2281323002/diff/120001/chrome/browser/background/background_contents_service.cc#newcode447 chrome/browser/background/background_contents_service.cc:447: RestartForceInstalledExtensionOnCrash(extension, profile); I'm not an OWNER here, but since ...
4 years, 3 months ago (2016-08-29 20:22:05 UTC) #31
apacible
https://codereview.chromium.org/2281323002/diff/120001/chrome/browser/background/background_contents_service.cc File chrome/browser/background/background_contents_service.cc (right): https://codereview.chromium.org/2281323002/diff/120001/chrome/browser/background/background_contents_service.cc#newcode447 chrome/browser/background/background_contents_service.cc:447: RestartForceInstalledExtensionOnCrash(extension, profile); On 2016/08/29 20:22:04, Devlin wrote: > I'm ...
4 years, 3 months ago (2016-08-29 23:26:34 UTC) #32
Andrew T Wilson (Slow)
Thanks for clarifying - agreed that the auto-restart behavior for component extensions deserves the special ...
4 years, 3 months ago (2016-08-30 08:24:57 UTC) #33
Andrew T Wilson (Slow)
Thanks for clarifying - agreed that the auto-restart behavior for component extensions deserves the special ...
4 years, 3 months ago (2016-08-30 08:24:57 UTC) #34
apacible
https://codereview.chromium.org/2281323002/diff/120001/chrome/browser/background/background_contents_service.cc File chrome/browser/background/background_contents_service.cc (right): https://codereview.chromium.org/2281323002/diff/120001/chrome/browser/background/background_contents_service.cc#newcode447 chrome/browser/background/background_contents_service.cc:447: RestartForceInstalledExtensionOnCrash(extension, profile); On 2016/08/30 08:24:57, Andrew T Wilson (Slow) ...
4 years, 3 months ago (2016-08-30 23:54:15 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2281323002/160001
4 years, 3 months ago (2016-08-31 03:16:06 UTC) #43
commit-bot: I haz the power
Committed patchset #3 (id:160001)
4 years, 3 months ago (2016-08-31 04:28:33 UTC) #45
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/fb3b9fae7ff5afefa0275f1c8d30351fbfde81fc Cr-Commit-Position: refs/heads/master@{#415555}
4 years, 3 months ago (2016-08-31 04:31:22 UTC) #47
Wez
https://codereview.chromium.org/2281323002/diff/160001/chrome/browser/background/background_contents_service.cc File chrome/browser/background/background_contents_service.cc (right): https://codereview.chromium.org/2281323002/diff/160001/chrome/browser/background/background_contents_service.cc#newcode551 chrome/browser/background/background_contents_service.cc:551: backoff_map_.insert( You're inserting a new entry into backoff_map_ here ...
4 years, 3 months ago (2016-09-01 21:47:59 UTC) #49
apacible
4 years, 3 months ago (2016-09-02 00:20:33 UTC) #50
Message was sent while issue was closed.
https://codereview.chromium.org/2281323002/diff/160001/chrome/browser/backgro...
File chrome/browser/background/background_contents_service.cc (right):

https://codereview.chromium.org/2281323002/diff/160001/chrome/browser/backgro...
chrome/browser/background/background_contents_service.cc:551:
backoff_map_.insert(
On 2016/09/01 21:47:58, Wez wrote:
> You're inserting a new entry into backoff_map_ here but never erase()ing it -
> should it be cleaned-up similarly to content_map_, so that we can have a
> destructor DCHECK(empty) as we do for that?

Good catch. I'll address this in a follow up CL.

https://codereview.chromium.org/2281323002/diff/160001/chrome/browser/backgro...
chrome/browser/background/background_contents_service.cc:559: restart_delay =
entry->GetTimeUntilRelease().InMilliseconds();
On 2016/09/01 21:47:58, Wez wrote:
> When do we re-set the backoff for an extension, if ever?
> 
> e.g. if an extension happens to hit a crash every so often then won't the
> restart delay still ramp up, over time, to some arbitrary level?
> 
> e.g. if WebRTC sometimes crashes the MR extension then after a dozen crashes
the
> Cast feature will seem to be completely broken?

We currently do not reset the backoff within the same browser session.

Chatted offline - it would make sense reset the backoff entry after the
background contents normally shuts down or after has been running continuously
for a fixed time (e.g. one minute).

Powered by Google App Engine
This is Rietveld 408576698