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

Issue 9420036: Also delay regular profile destruction... (Closed)

Created:
8 years, 10 months ago by MAD
Modified:
8 years, 6 months ago
CC:
sky, Ben Goodger (Google), chromium-reviews, rginda+watch_chromium.org, achuith+watch_chromium.org, sail, marja, Alexei Svitkine (slow)
Visibility:
Public.

Description

Also delay regular profile destruction... A previous CL delayed the destruction of Off The Record profiles, but there are cases where they are delayed post destruction of their original profile... no good... So we now delay the destruction of both the off the record profile and it's original profile when either of them is still referenced by a render process host. BUG=114245 TEST=unittest --gtest_filter=ProfileDestroyerTest.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=123082 Got reverted because of failures in extension api tests, so trying again with fix in extension tests to avoid an infobar leak, which was keeping a render process host alive for too long and causing an assert that not all profiles were destroyed... Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=138038

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 2

Patch Set 4 : Now making sure the profiler manager is destroyed in the UI thread. #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : Rebase / Merge #

Patch Set 8 : Now handle TestProfile correctly #

Patch Set 9 : Sync #

Patch Set 10 : Merge Goof fix... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -117 lines) Patch
M chrome/browser/profiles/profile_destroyer.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/profiles/profile_destroyer.cc View 1 2 3 4 5 6 7 2 chunks +17 lines, -7 lines 0 comments Download
A chrome/browser/profiles/profile_destroyer_unittest.cc View 1 2 3 4 5 6 1 chunk +138 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_manager.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/profiles/profile_manager.cc View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_manager_unittest.cc View 1 2 3 4 5 6 1 chunk +6 lines, -3 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/browser_unittest.cc View 1 2 3 4 5 6 2 chunks +0 lines, -62 lines 0 comments Download
M chrome/test/base/browser_with_test_window_test.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -3 lines 0 comments Download
M chrome/test/base/browser_with_test_window_test.cc View 1 2 3 4 5 6 7 8 9 3 chunks +9 lines, -1 line 0 comments Download
D chrome/test/data/extensions/api_test/get_views/infobar.html View 1 2 3 4 5 6 1 chunk +0 lines, -6 lines 0 comments Download
D chrome/test/data/extensions/api_test/get_views/infobar.js View 1 2 3 4 5 6 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/test/data/extensions/api_test/get_views/manifest.json View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
A + chrome/test/data/extensions/api_test/get_views/popup.html View 1 2 3 4 5 6 1 chunk +4 lines, -2 lines 0 comments Download
A + chrome/test/data/extensions/api_test/get_views/popup.js View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/get_views/test.js View 1 2 3 4 5 6 2 chunks +17 lines, -21 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
MAD
Please validate the approach (and the code of course :-), I asked marja@ for the ...
8 years, 10 months ago (2012-02-17 01:35:03 UTC) #1
marja
I haven't worked on profile deletion / profile lifetime / incognito profiles, so I guess ...
8 years, 10 months ago (2012-02-17 08:34:42 UTC) #2
MAD
OK, Rachel, can you CR this please? Otherwise, please let me know, and I'll put ...
8 years, 10 months ago (2012-02-17 15:52:08 UTC) #3
sky
https://chromiumcodereview.appspot.com/9420036/diff/2003/chrome/browser/profiles/profile_destroyer.cc File chrome/browser/profiles/profile_destroyer.cc (right): https://chromiumcodereview.appspot.com/9420036/diff/2003/chrome/browser/profiles/profile_destroyer.cc#newcode19 chrome/browser/profiles/profile_destroyer.cc:19: // Some tests try to destroy their profile on ...
8 years, 10 months ago (2012-02-17 16:53:09 UTC) #4
MAD
OK, I'll find and fix all the tests that destroy a profile from the wrong ...
8 years, 10 months ago (2012-02-17 17:06:09 UTC) #5
rpetterson
I have limited computer access today so if you need this reviewed before next week, ...
8 years, 10 months ago (2012-02-17 21:22:10 UTC) #6
MAD
How about this for making sure that the testing browser process always destroy the profile ...
8 years, 10 months ago (2012-02-17 21:22:50 UTC) #7
MAD
On Fri, Feb 17, 2012 at 4:22 PM, Rachel Weinstein Petterson < rlp@chromium.org> wrote: > ...
8 years, 10 months ago (2012-02-17 21:27:26 UTC) #8
MAD
Friendly post long weekend ping... All bots are happy... :-) Now waiting for a full ...
8 years, 10 months ago (2012-02-21 19:51:10 UTC) #9
rpetterson
LGTM for profiles.
8 years, 10 months ago (2012-02-21 22:41:50 UTC) #10
sky
LGTM
8 years, 10 months ago (2012-02-22 17:52:11 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mad@chromium.org/9420036/9007
8 years, 10 months ago (2012-02-22 18:09:26 UTC) #12
MAD
Thanks all... :) On Wed, Feb 22, 2012 at 1:09 PM, <commit-bot@chromium.org> wrote: > CQ ...
8 years, 10 months ago (2012-02-22 18:11:55 UTC) #13
commit-bot: I haz the power
Change committed as 123082
8 years, 10 months ago (2012-02-22 19:42:00 UTC) #14
MAD
Don't delay the destruction of the TestProfile
8 years, 7 months ago (2012-05-11 17:04:30 UTC) #15
MAD
Don't delay the destruction of the TestProfile
8 years, 7 months ago (2012-05-11 17:10:11 UTC) #16
MAD
Can you take a look at the latest change I did to the profile destroyer? ...
8 years, 7 months ago (2012-05-11 17:18:46 UTC) #17
MAD
On 2012/05/11 17:18:46, MAD wrote: > Can you take a look at the latest change ...
8 years, 7 months ago (2012-05-11 17:25:47 UTC) #18
MAD
Now handle TestProfile correctly
8 years, 7 months ago (2012-05-11 17:28:31 UTC) #19
MAD
OK, now you can look at it and see all the merges in Patch Set ...
8 years, 7 months ago (2012-05-11 17:30:53 UTC) #20
sky
LGTM
8 years, 7 months ago (2012-05-11 17:35:47 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mad@chromium.org/9420036/49018
8 years, 7 months ago (2012-05-11 17:52:42 UTC) #22
MAD
Thanks sky@!... rpetterson@, I'll hit the commit queue now, let me know if you have ...
8 years, 7 months ago (2012-05-11 17:52:45 UTC) #23
rpetterson
lgtm
8 years, 7 months ago (2012-05-11 18:21:23 UTC) #24
MAD
Thanks! On Fri, May 11, 2012 at 2:21 PM, <rlp@chromium.org> wrote: > lgtm > > ...
8 years, 7 months ago (2012-05-11 18:36:48 UTC) #25
commit-bot: I haz the power
Try job failure for 9420036-49018 (retry) on mac_rel for step "browser_tests". It's a second try, ...
8 years, 7 months ago (2012-05-11 18:54:42 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mad@chromium.org/9420036/57019
8 years, 7 months ago (2012-05-16 19:36:45 UTC) #27
commit-bot: I haz the power
Try job failure for 9420036-57019 (retry) on mac_rel for step "compile" (clobber build). It's a ...
8 years, 7 months ago (2012-05-16 20:04:22 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mad@chromium.org/9420036/57036
8 years, 7 months ago (2012-05-16 20:26:17 UTC) #29
commit-bot: I haz the power
Try job failure for 9420036-57036 (retry) on mac_rel for step "browser_tests". It's a second try, ...
8 years, 7 months ago (2012-05-16 21:17:31 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mad@chromium.org/9420036/57036
8 years, 7 months ago (2012-05-19 13:22:47 UTC) #31
commit-bot: I haz the power
Change committed as 138038
8 years, 7 months ago (2012-05-19 14:37:10 UTC) #32
willchan no longer on Chromium
This change effectively makes Profile refcounted, which I think is undesirable. Can we fix the ...
8 years, 6 months ago (2012-06-06 21:31:03 UTC) #33
MAD
On 2012/06/06 21:31:03, willchan wrote: > This change effectively makes Profile refcounted, which I think ...
8 years, 6 months ago (2012-06-06 21:34:51 UTC) #34
willchan no longer on Chromium
I think this is a very good question. I know why you did your fix, ...
8 years, 6 months ago (2012-06-06 21:45:19 UTC) #35
Elliot Glaysher
On 2012/06/06 21:45:19, willchan wrote: > Also, I have to worry that since Profile is ...
8 years, 6 months ago (2012-06-06 21:48:15 UTC) #36
MAD
The problem with releasing the RPH when the profile gets destroyed is that the RPH ...
8 years, 6 months ago (2012-06-06 22:00:55 UTC) #37
rpetterson
I've actually been banging my head over a situation similar to what Elliot pointed out: ...
8 years, 6 months ago (2012-06-07 18:21:48 UTC) #38
rpetterson
8 years, 6 months ago (2012-06-18 21:53:32 UTC) #39
The issue I was investigating turned out to be unrelated to this, just FYI.

On 2012/06/07 18:21:48, rpetterson wrote:
> I've actually been banging my head over a situation similar to what Elliot
> pointed out:  http://code.google.com/p/chromium/issues/detail?id=127607
> 
> It might be related to Marc-Andre's change, but the revision numbers don't
> quite match up. In any case, since it seems related to the profile
> destruction/writing issue at hand, wanted to bring it to attention.
> 
> On Wed, Jun 6, 2012 at 3:00 PM, Marc-Andre Decoste <mailto:mad@chromium.org>
wrote:
> 
> > The problem with releasing the RPH when the profile gets destroyed is that
> > the RPH has a pointer back to the profile, and it might try to use it as
> > the profile is being destroyed... So we would need some way to make sure
> > the RPH goes away, before we enter the Profile destructor...
> >
> > On Wed, Jun 6, 2012 at 5:45 PM, William Chan (陈智昌)
> <willchan@chromium.org>wrote:
> >
> >> I think this is a very good question. I know why you did your fix,
> >> because getting the ownership/lifetime management correct is difficult. But
> >> the refcounting bandaid often causes other issues. I got alerted to it due
> >> to http://code.google.com/p/chromium/issues/detail?id=130772. Also, I
> >> have to worry that since Profile is getting leaked due to leaked RPHs, we
> >> aren't persisting some important Profile related state on shutdown. So we
> >> really ought to simply solve the RPH leakage issue.
> >>
> >> I think the problem is that RPH itself is RefCountedThreadSafe, which
> >> makes reasoning about its lifetime management difficult. What we really
> >> want is for RenderProcessHost to be a node in the dependency tree where the
> >> Profile is the root. That way, when the Profile goes away, we can kill the
> >> RPH. My suspicion is that there is no direct path from Profile to RPHs, so
> >> the the lifetime is not well-defined, leading to RPH leaks / delayed
> >> destructions. Establishing a direct path will require reading a lot of code
> >> to understand the dependency chain, but is the "right" solution IMO.
> >>
> >>
> >> On Wed, Jun 6, 2012 at 2:34 PM, <mailto:mad@chromium.org> wrote:
> >>
> >>> On 2012/06/06 21:31:03, willchan wrote:
> >>>
> >>>> This change effectively makes Profile refcounted, which I think is
> >>>>
> >>> undesirable.
> >>>
> >>>> Can we fix the root problem instead, that renderer processes are not
> >>>> getting
> >>>> destroyed on time / getting leaked?
> >>>>
> >>>
> >>> I couldn't find a way to do that reliably, so I decided to delay the
> >>> profile
> >>> destruction instead... Which I felt was safe, since profiles are usually
> >>> destroyed pretty late in the game anyway... I guess I was wrong... :-(
> >>>
> >>> Any idea on how we could reliably make sure the render process host are
> >>> destroyed on time?
> >>>
> >>>
>
https://chromiumcodereview.**appspot.com/9420036/%3Chttps://chromiumcoderevie...>
> >>>
> >>
> >>
> >

Powered by Google App Engine
This is Rietveld 408576698