New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 749134 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

ChromeActivity.onDeferredStartup is called too often for subclasses

Project Member Reported by yfried...@chromium.org, Jul 26 2017

Issue description

I noticed that the volume for webapk shell version recording jumped dramatically: https://uma.googleplex.com/p/chrome/timeline_v2/?sid=8f3053080336df8f3187fe409fb3a55d
but we didn't increase any webapk rollouts and if you look at histograms for launch counts, those didn't increase either. Looking at the diff log, I found this CL: https://codereview.chromium.org/2960843003 (which I reviewed!) but I realize this is broken.

Moving the conditional to early-out in onDeferredStartup doesn't work because several subclasses of ChromeActivity will always be run.

+ted as FYI in case you see anything interesting in your neck of the woods. This could impact a few random things.

+kouhei as this affects MemoryAndroid.DeviceMemoryClass
 
Cc: wychen@chromium.org
+wychen@ for startup things

My proposed fix would be to make ChromeActivity#initDeferredStartupForActivity protected and migrate all child classes overridden behavior to that.  ChromeActivity#onDeferredStartup should then be made final so it is the gate keeper for ensuring things are run just once.

Comment 2 by kouhei@chromium.org, Jul 26 2017

Cc: memory-dev@chromium.org
re: MemoryAndroid.DeviceMemoryClass
I'm not sure if the memory team actually look at the UMA today. May be we can rip the logic entirely?

+memory-dev
I'm going to go for a straight revert of the breakage to merge to M61 but we can follow-up with suggested clean-ups per #1 and maybe #2 depending on outcome there
Project Member

Comment 4 by bugdroid1@chromium.org, Jul 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4c63a5002110cb17e715ccae921ff6a5d8df7cb4

commit 4c63a5002110cb17e715ccae921ff6a5d8df7cb4
Author: Yaron Friedman <yfriedman@chromium.org>
Date: Wed Jul 26 18:40:39 2017

Revert breakage from  Issue 2960843003: Remove UMA.Debug.EnableCrashUpload.*

We need to early-out *before* calling onDeferredStartup so that we don't
unnecessarily invoke subclasses' implementation of onDeferredStartup
BUG=749134

Change-Id: I9b9b6aeda41c21e1b3c7166866dbf31102f716e1
Reviewed-on: https://chromium-review.googlesource.com/587035
Reviewed-by: Peter Kotwicz <pkotwicz@chromium.org>
Commit-Queue: Yaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489709}
[modify] https://crrev.com/4c63a5002110cb17e715ccae921ff6a5d8df7cb4/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java

Comment 5 by wychen@chromium.org, Jul 27 2017

I'm working on the clean up per #c1. One related question: ChromeTabbedActivity#ChromeTabbedActivity() calls addDeferredTask() after queueDeferredTasksOnIdleHandler(). In practice there's no way the deferred tasks added before queueDeferredTasksOnIdleHandler() can all finish before the late addDeferredTask() call, but the ordering still looks wrong.

Should we check no addDeferredTask() is called after queueDeferredTasksOnIdleHandler()?
Just waiting to get stats confirmation for #4 (should have them on Monday) and then I'll request merge to the branch.
Project Member

Comment 7 by bugdroid1@chromium.org, Jul 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9be64132789f5acbcd61b16355d1573b21666446

commit 9be64132789f5acbcd61b16355d1573b21666446
Author: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Date: Fri Jul 28 17:40:34 2017

Make sure ChromeActivity#onDeferredStartup is only called once

Made onDeferredStartup() private, and moved the overridden behavior
to initDeferredStartupForActivity().

Bug: 749134
Change-Id: I196437524485504d74ebcedb4f480cf4aa13b62e
Reviewed-on: https://chromium-review.googlesource.com/590081
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490449}
[modify] https://crrev.com/9be64132789f5acbcd61b16355d1573b21666446/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
[modify] https://crrev.com/9be64132789f5acbcd61b16355d1573b21666446/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
[modify] https://crrev.com/9be64132789f5acbcd61b16355d1573b21666446/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java

Labels: Merge-Request-61
The volume has come down as expected on canary: https://uma.googleplex.com/p/chrome/timeline_v2/?sid=b2a50a30e82732e5dc4a7fc742ac038c

Requesting merge for cl in comment 4 only.
Project Member

Comment 9 by sheriffbot@chromium.org, Jul 31 2017

Labels: -Merge-Request-61 Merge-Review-61 Hotlist-Merge-Review
This bug requires manual review: Reverts referenced in bugdroid comments after merge request.
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), ketakid @(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-61 Merge-Rejected-61
Merge rejected for M61 - you have provided no context for why this is important or why we should approve it (I can't parse it from the thread above either, but the request comment should provide it explicitly).  Please see go/chrome-merges for the type of data we'd like to see on merge requests.

Please re-apply the merge request with appropriate rationale and it'll be reconsidered.
Labels: -Merge-Rejected-61 Merge-Request-61
Re-requesting for the Cl in #4 only which is a partial-revert (no new code). This specific issue is that a metric is over-reported and incorrect but it's possible there's more breakage - I haven't gone through and traced all the code which was supposed to be guarded by this check but there could be more bugs. I think it's a very low-risk change and helps avoid surprises later
Project Member

Comment 12 by sheriffbot@chromium.org, Aug 4 2017

Labels: -Merge-Request-61 Merge-Review-61
This bug requires manual review: Reverts referenced in bugdroid comments after merge request.
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), ketakid @(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-61 Merge-Approved-61
Merge approved for M61 branch 3163.
Project Member

Comment 14 by bugdroid1@chromium.org, Aug 4 2017

Labels: -merge-approved-61 merge-merged-3163
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/040df85b2d13b356b630d8161e8940d4e4ce39b9

commit 040df85b2d13b356b630d8161e8940d4e4ce39b9
Author: Yaron Friedman <yfriedman@chromium.org>
Date: Fri Aug 04 19:18:09 2017

Revert breakage from  Issue 2960843003: Remove UMA.Debug.EnableCrashUpload.*

We need to early-out *before* calling onDeferredStartup so that we don't
unnecessarily invoke subclasses' implementation of onDeferredStartup
BUG=749134
TBR=yfriedman@chromium.org

(cherry picked from commit 4c63a5002110cb17e715ccae921ff6a5d8df7cb4)

Change-Id: I9b9b6aeda41c21e1b3c7166866dbf31102f716e1
Reviewed-on: https://chromium-review.googlesource.com/587035
Reviewed-by: Peter Kotwicz <pkotwicz@chromium.org>
Commit-Queue: Yaron Friedman <yfriedman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#489709}
Reviewed-on: https://chromium-review.googlesource.com/602480
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/branch-heads/3163@{#322}
Cr-Branched-From: ff259bab28b35d242e10186cd63af7ed404fae0d-refs/heads/master@{#488528}
[modify] https://crrev.com/040df85b2d13b356b630d8161e8940d4e4ce39b9/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java

Owner: kouhei@chromium.org
Patch merged to 3163. assigning to kouhei@ for follow-up on trunk for the comments he made
Cc: haraken@chromium.org
Labels: -Pri-1 Pri-3
Owner: haraken@chromium.org
Lowering to P3. 
haraken; Would you help triage/assign?

Sign in to add a comment