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

Issue 349263004: Fix Windows logoff race. (Closed)

Created:
6 years, 6 months ago by Sigurður Ásgeirsson
Modified:
6 years, 5 months ago
CC:
chromium-reviews
Project:
chromium
Visibility:
Public.

Description

Fix Windows logoff race by posting a sentinel task to each taskrunner used to save state, and blocking on the completion of all sentinels. De-flake and re-enable ProfileBrowserTests, by not running the tasks queued to initialize Bookmarks. This caused test failures when the delayed initialization managed to run. This depends on https://codereview.chromium.org/370323002/, which fixes a BookmarkStorage lifetime issue, and https://codereview.chromium.org/375683002/ which annotates a remaining leak. TBR=sky@chromium.org, brettw@chromium.org R=erikwright@chromium.org, gab=chromium.org, brettw@chromium.org BUG=386126, 141141, 141517, 142787, 140882, 165760, 163713, 391508 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=281746 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=281807

Patch Set 1 #

Total comments: 16

Patch Set 2 : Address Gab and Erik's comments. #

Total comments: 4

Patch Set 3 : Address Gab's comments. #

Patch Set 4 : Rejig the rundown post accounting for better encapsulation. #

Total comments: 4

Patch Set 5 : Start counter at one and maintain throughout lifetime for easier use. #

Patch Set 6 : Remove unused static function. #

Total comments: 8

Patch Set 7 : Address Gab's comments. #

Total comments: 1

Patch Set 8 : De-flake ProfileBrowserTest and add an EndSession test. #

Patch Set 9 : Enable all profile tests, remove #if 0 code. Rebase to ToT. #

Total comments: 17

Patch Set 10 : Address Monica's comment. #

Total comments: 2

Patch Set 11 : Test that Profile settings are written through to disk on EndSession. #

Total comments: 8

Patch Set 12 : Remove refcounting from BookmarkStorage. #

Patch Set 13 : Add an annotation for the remaining leak, as I can't see how to fix it. #

Patch Set 14 : Moar better documentation on leak. #

Patch Set 15 : Address Monicas and Gabs comments. #

Patch Set 16 : BookmarkStorage changes pulled out to issue 370323002. #

Total comments: 2

Patch Set 17 : ChromeBookmarkClient changes pulled out to issue 375683002. #

Total comments: 3

Patch Set 18 : Fix build break by compiling EndSession test conditionally. #

Patch Set 19 : Also make a file-local function conditionally compiled with its sole user. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+207 lines, -65 lines) Patch
M chrome/browser/browser_process_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +82 lines, -19 lines 0 comments Download
M chrome/browser/lifetime/application_lifetime.cc View 1 2 3 chunks +12 lines, -3 lines 0 comments Download
M chrome/browser/profiles/profile_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 11 chunks +113 lines, -43 lines 0 comments Download

Messages

Total messages: 61 (0 generated)
gab
Nice job hunting this down! s/tak/task in CL description https://codereview.chromium.org/349263004/diff/1/chrome/browser/browser_process_impl.cc File chrome/browser/browser_process_impl.cc (right): https://codereview.chromium.org/349263004/diff/1/chrome/browser/browser_process_impl.cc#newcode384 chrome/browser/browser_process_impl.cc:384: ...
6 years, 6 months ago (2014-06-23 19:53:48 UTC) #1
erikwright (departed)
I agree with Gab's suggestion. https://codereview.chromium.org/349263004/diff/1/chrome/browser/lifetime/application_lifetime.cc File chrome/browser/lifetime/application_lifetime.cc (right): https://codereview.chromium.org/349263004/diff/1/chrome/browser/lifetime/application_lifetime.cc#newcode286 chrome/browser/lifetime/application_lifetime.cc:286: base::KillProcess(base::Process::Current().handle(), 0, false); Is ...
6 years, 6 months ago (2014-06-23 19:59:00 UTC) #2
Sigurður Ásgeirsson
Thanks - PTAL while I try and find a way to add some tests to ...
6 years, 6 months ago (2014-06-23 20:20:12 UTC) #3
gab
https://codereview.chromium.org/349263004/diff/1/chrome/browser/browser_process_impl.cc File chrome/browser/browser_process_impl.cc (right): https://codereview.chromium.org/349263004/diff/1/chrome/browser/browser_process_impl.cc#newcode384 chrome/browser/browser_process_impl.cc:384: class RundownTaskCounter { On 2014/06/23 20:20:12, Sigurður Ásgeirsson wrote: ...
6 years, 6 months ago (2014-06-23 21:09:54 UTC) #4
Sigurður Ásgeirsson
Thanks - liking the look of this yet? https://codereview.chromium.org/349263004/diff/1/chrome/browser/browser_process_impl.cc File chrome/browser/browser_process_impl.cc (right): https://codereview.chromium.org/349263004/diff/1/chrome/browser/browser_process_impl.cc#newcode454 chrome/browser/browser_process_impl.cc:454: base::Bind(RundownTaskCounter::Decrement, ...
6 years, 6 months ago (2014-06-23 21:39:59 UTC) #5
erikwright (departed)
Is there a browser test that covers this scenario? https://codereview.chromium.org/349263004/diff/1/chrome/browser/browser_process_impl.cc File chrome/browser/browser_process_impl.cc (right): https://codereview.chromium.org/349263004/diff/1/chrome/browser/browser_process_impl.cc#newcode384 chrome/browser/browser_process_impl.cc:384: ...
6 years, 6 months ago (2014-06-24 16:10:53 UTC) #6
Sigurður Ásgeirsson
> > The concern about multiple 1->0 transitions is not founded as you would > ...
6 years, 6 months ago (2014-06-24 16:48:17 UTC) #7
Sigurður Ásgeirsson
I don't see any tests exercising this, will keep looking. https://codereview.chromium.org/349263004/diff/60001/chrome/browser/browser_process_impl.cc File chrome/browser/browser_process_impl.cc (right): https://codereview.chromium.org/349263004/diff/60001/chrome/browser/browser_process_impl.cc#newcode394 ...
6 years, 6 months ago (2014-06-24 17:17:27 UTC) #8
gab
Code looks good. I would still have a slight preference to have lifetime management and ...
6 years, 6 months ago (2014-06-25 14:21:51 UTC) #9
Sigurður Ásgeirsson
Since I'm vehemently opposed to mixing lifetime management and other state, we've agreed not to ...
6 years, 6 months ago (2014-06-25 15:05:02 UTC) #10
Sigurður Ásgeirsson
Hey guys, I feel testing for this and the finch experiment ought to be separate ...
6 years, 6 months ago (2014-06-25 15:08:23 UTC) #11
gab
lgtm w/ nit I would like to see a test in the same CL as: ...
6 years, 6 months ago (2014-06-25 15:23:37 UTC) #12
sky
I like writing a test too in this patch. On Wed, Jun 25, 2014 at ...
6 years, 6 months ago (2014-06-25 16:54:51 UTC) #13
Sigurður Ásgeirsson
Hey guys, thanks for keeping me honest. I think this might be the right place ...
6 years, 6 months ago (2014-06-25 19:47:51 UTC) #14
Sigurður Ásgeirsson
Please take (another) look.
6 years, 5 months ago (2014-07-03 17:59:11 UTC) #15
noms (inactive)
https://codereview.chromium.org/349263004/diff/160001/chrome/browser/profiles/profile_browsertest.cc File chrome/browser/profiles/profile_browsertest.cc (right): https://codereview.chromium.org/349263004/diff/160001/chrome/browser/profiles/profile_browsertest.cc#newcode136 chrome/browser/profiles/profile_browsertest.cc:136: FlushIoTaskRunnerAndSpinThreads(); Is this used by every test? Could it ...
6 years, 5 months ago (2014-07-03 18:07:11 UTC) #16
Sigurður Ásgeirsson
PTAL? https://codereview.chromium.org/349263004/diff/160001/chrome/browser/profiles/profile_browsertest.cc File chrome/browser/profiles/profile_browsertest.cc (right): https://codereview.chromium.org/349263004/diff/160001/chrome/browser/profiles/profile_browsertest.cc#newcode136 chrome/browser/profiles/profile_browsertest.cc:136: FlushIoTaskRunnerAndSpinThreads(); On 2014/07/03 18:07:11, Monica Dinculescu wrote: > ...
6 years, 5 months ago (2014-07-03 18:14:46 UTC) #17
noms (inactive)
profiles lgtm w/ annoying comment request. Thanks for re-enabling the tests! https://codereview.chromium.org/349263004/diff/160001/chrome/browser/profiles/profile_browsertest.cc File chrome/browser/profiles/profile_browsertest.cc (right): ...
6 years, 5 months ago (2014-07-03 18:23:42 UTC) #18
Sigurður Ásgeirsson
Thanks! https://codereview.chromium.org/349263004/diff/160001/chrome/browser/profiles/profile_browsertest.cc File chrome/browser/profiles/profile_browsertest.cc (right): https://codereview.chromium.org/349263004/diff/160001/chrome/browser/profiles/profile_browsertest.cc#newcode326 chrome/browser/profiles/profile_browsertest.cc:326: SpinThreads(); On 2014/07/03 18:23:42, Monica Dinculescu wrote: > ...
6 years, 5 months ago (2014-07-03 18:28:59 UTC) #19
Sigurður Ásgeirsson
https://codereview.chromium.org/349263004/diff/160001/chrome/browser/profiles/profile_browsertest.cc File chrome/browser/profiles/profile_browsertest.cc (right): https://codereview.chromium.org/349263004/diff/160001/chrome/browser/profiles/profile_browsertest.cc#newcode326 chrome/browser/profiles/profile_browsertest.cc:326: SpinThreads(); On 2014/07/03 18:28:58, Sigurður Ásgeirsson wrote: > On ...
6 years, 5 months ago (2014-07-03 18:51:09 UTC) #20
Sigurður Ásgeirsson
6 years, 5 months ago (2014-07-03 18:51:12 UTC) #21
gab
lgtm w/ test suggestion to prevent regressions. PS: THIS IS SO AWESOME, thanks for fighting ...
6 years, 5 months ago (2014-07-03 18:56:56 UTC) #22
gab
https://codereview.chromium.org/349263004/diff/180001/chrome/browser/profiles/profile_browsertest.cc File chrome/browser/profiles/profile_browsertest.cc (right): https://codereview.chromium.org/349263004/diff/180001/chrome/browser/profiles/profile_browsertest.cc#newcode323 chrome/browser/profiles/profile_browsertest.cc:323: g_browser_process->EndSession(); Also, this test should explicitly touch a pref ...
6 years, 5 months ago (2014-07-03 18:59:26 UTC) #23
erikwright (departed)
https://codereview.chromium.org/349263004/diff/160001/chrome/browser/browser_process_impl.cc File chrome/browser/browser_process_impl.cc (right): https://codereview.chromium.org/349263004/diff/160001/chrome/browser/browser_process_impl.cc#newcode393 chrome/browser/browser_process_impl.cc:393: // Posts a rundown task to |task_runner|, can be ...
6 years, 5 months ago (2014-07-03 19:06:42 UTC) #24
Sigurður Ásgeirsson
Hey guys, I rejigged the EndSession test per request. Turns out the test-created profile is ...
6 years, 5 months ago (2014-07-04 13:23:37 UTC) #25
gab
Latest test lgtm w/ nits (I'll look into adding a timer check around EndSession in ...
6 years, 5 months ago (2014-07-04 15:22:18 UTC) #26
noms (inactive)
https://codereview.chromium.org/349263004/diff/200001/chrome/browser/profiles/profile_browsertest.cc File chrome/browser/profiles/profile_browsertest.cc (right): https://codereview.chromium.org/349263004/diff/200001/chrome/browser/profiles/profile_browsertest.cc#newcode345 chrome/browser/profiles/profile_browsertest.cc:345: for (size_t i = 0; i < loaded_profiles.size(); ++i) ...
6 years, 5 months ago (2014-07-04 15:41:19 UTC) #27
Sigurður Ásgeirsson
Hey y'all, I think this is ready for prime time. This fixes the Windows logoff ...
6 years, 5 months ago (2014-07-04 20:59:22 UTC) #28
gab
lgtm++ w/ 2 nits mentioned on prior patch sets. Please also expand the CL description ...
6 years, 5 months ago (2014-07-04 23:39:27 UTC) #29
Sigurður Ásgeirsson
Thanks! https://codereview.chromium.org/349263004/diff/200001/chrome/browser/profiles/profile_browsertest.cc File chrome/browser/profiles/profile_browsertest.cc (right): https://codereview.chromium.org/349263004/diff/200001/chrome/browser/profiles/profile_browsertest.cc#newcode86 chrome/browser/profiles/profile_browsertest.cc:86: return ""; On 2014/07/04 23:39:27, gab wrote: > ...
6 years, 5 months ago (2014-07-05 20:03:02 UTC) #30
Sigurður Ásgeirsson
Hey guys, it occurred to me that it might be OK to clean up the ...
6 years, 5 months ago (2014-07-05 20:06:36 UTC) #31
Sigurður Ásgeirsson
On Fri, Jul 4, 2014 at 7:39 PM, <gab@chromium.org> wrote: > lgtm++ w/ 2 nits ...
6 years, 5 months ago (2014-07-05 20:12:44 UTC) #32
Sigurður Ásgeirsson
Here's what that looks like: https://codereview.chromium.org/372663002/diff2/40001:60001/chrome/browser/bookmarks/chrome_bookmark_client.cc On Sat, Jul 5, 2014 at 4:06 PM, Sigurður ...
6 years, 5 months ago (2014-07-06 18:02:02 UTC) #33
gab
Hey Siggi, I think that probably makes sense. The UI thread only keeps the pointer ...
6 years, 5 months ago (2014-07-07 13:13:40 UTC) #34
Sigurður Ásgeirsson
Ok, I pulled the BookmarkStorage changes out to https://codereview.chromium.org/370323002/. Brett, please give us owner blessing ...
6 years, 5 months ago (2014-07-07 17:46:54 UTC) #35
Shrikant Kelkar
https://codereview.chromium.org/349263004/diff/340001/chrome/browser/lifetime/application_lifetime.cc File chrome/browser/lifetime/application_lifetime.cc (right): https://codereview.chromium.org/349263004/diff/340001/chrome/browser/lifetime/application_lifetime.cc#newcode288 chrome/browser/lifetime/application_lifetime.cc:288: base::KillProcess(base::Process::Current().handle(), 0, false); Instead of killing here, can we ...
6 years, 5 months ago (2014-07-07 20:02:58 UTC) #36
Sigurður Ásgeirsson
thanks https://codereview.chromium.org/349263004/diff/340001/chrome/browser/lifetime/application_lifetime.cc File chrome/browser/lifetime/application_lifetime.cc (right): https://codereview.chromium.org/349263004/diff/340001/chrome/browser/lifetime/application_lifetime.cc#newcode288 chrome/browser/lifetime/application_lifetime.cc:288: base::KillProcess(base::Process::Current().handle(), 0, false); On 2014/07/07 20:02:58, Shrikant Kelkar ...
6 years, 5 months ago (2014-07-07 20:17:18 UTC) #37
Sigurður Ásgeirsson
So cpu and I scrubbed through a bit of code. Apparently the ChromeAppView code that ...
6 years, 5 months ago (2014-07-07 21:39:59 UTC) #38
Shrikant Kelkar
lgtm! I debugged this bit with your patch as I was worrying more about restore ...
6 years, 5 months ago (2014-07-07 23:05:03 UTC) #39
gab
Yea tabs to be restored are stored in prefs which are explicitly flushed in EndSession() ...
6 years, 5 months ago (2014-07-07 23:08:06 UTC) #40
Sigurður Ásgeirsson
The CQ bit was checked by siggi@chromium.org
6 years, 5 months ago (2014-07-08 10:27:31 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siggi@chromium.org/349263004/360001
6 years, 5 months ago (2014-07-08 10:30:14 UTC) #42
commit-bot: I haz the power
Change committed as 281746
6 years, 5 months ago (2014-07-08 14:28:39 UTC) #43
maniscalco
A revert of this CL has been created in https://codereview.chromium.org/378863003/ by maniscalco@chromium.org. The reason for ...
6 years, 5 months ago (2014-07-08 16:17:35 UTC) #44
gab
+rsesek; see question below. Thanks! Gab https://codereview.chromium.org/349263004/diff/360001/chrome/browser/browser_process_impl.cc File chrome/browser/browser_process_impl.cc (right): https://codereview.chromium.org/349263004/diff/360001/chrome/browser/browser_process_impl.cc#newcode478 chrome/browser/browser_process_impl.cc:478: #if defined(USE_X11) || ...
6 years, 5 months ago (2014-07-08 16:24:03 UTC) #45
gab
Also, PS: I think it's fine to ifdef that test for X11/OS_WIN for now just ...
6 years, 5 months ago (2014-07-08 16:26:28 UTC) #46
Robert Sesek
https://codereview.chromium.org/349263004/diff/360001/chrome/browser/browser_process_impl.cc File chrome/browser/browser_process_impl.cc (right): https://codereview.chromium.org/349263004/diff/360001/chrome/browser/browser_process_impl.cc#newcode478 chrome/browser/browser_process_impl.cc:478: #if defined(USE_X11) || defined(OS_WIN) On 2014/07/08 16:24:03, gab wrote: ...
6 years, 5 months ago (2014-07-08 16:29:38 UTC) #47
gab
https://codereview.chromium.org/349263004/diff/360001/chrome/browser/browser_process_impl.cc File chrome/browser/browser_process_impl.cc (right): https://codereview.chromium.org/349263004/diff/360001/chrome/browser/browser_process_impl.cc#newcode478 chrome/browser/browser_process_impl.cc:478: #if defined(USE_X11) || defined(OS_WIN) On 2014/07/08 16:29:38, rsesek wrote: ...
6 years, 5 months ago (2014-07-08 16:48:58 UTC) #48
Sigurður Ásgeirsson
Hey Gab - PTAL?
6 years, 5 months ago (2014-07-08 16:58:30 UTC) #49
gab
On 2014/07/08 16:58:30, Sigurður Ásgeirsson wrote: > Hey Gab - PTAL? lgtm since EndSession() was ...
6 years, 5 months ago (2014-07-08 17:04:30 UTC) #50
Sigurður Ásgeirsson
The CQ bit was checked by siggi@chromium.org
6 years, 5 months ago (2014-07-08 17:06:49 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siggi@chromium.org/349263004/380001
6 years, 5 months ago (2014-07-08 17:08:48 UTC) #52
Sigurður Ásgeirsson
On Tue, Jul 8, 2014 at 1:04 PM, <gab@chromium.org> wrote: > On 2014/07/08 16:58:30, Sigurður ...
6 years, 5 months ago (2014-07-08 17:09:45 UTC) #53
Sigurður Ásgeirsson
Also, the test failure is hitting NOTREACHED() on Mac :). On Tue, Jul 8, 2014 ...
6 years, 5 months ago (2014-07-08 17:23:45 UTC) #54
Sigurður Ásgeirsson
The CQ bit was checked by siggi@chromium.org
6 years, 5 months ago (2014-07-08 17:52:45 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siggi@chromium.org/349263004/400001
6 years, 5 months ago (2014-07-08 17:55:15 UTC) #56
gab
On 2014/07/08 17:09:45, Sigurður Ásgeirsson wrote: > On Tue, Jul 8, 2014 at 1:04 PM, ...
6 years, 5 months ago (2014-07-08 17:55:35 UTC) #57
gab
On 2014/07/08 17:23:45, Sigurður Ásgeirsson wrote: > Also, the test failure is hitting NOTREACHED() on ...
6 years, 5 months ago (2014-07-08 17:57:09 UTC) #58
cpu1
Looks like it got reverted, see 386126 for details.
6 years, 5 months ago (2014-07-08 18:00:33 UTC) #59
Sigurður Ásgeirsson
Yups, I'm re-submitting with a fix... On Tue, Jul 8, 2014 at 2:00 PM, <cpu@google.com> ...
6 years, 5 months ago (2014-07-08 18:06:37 UTC) #60
commit-bot: I haz the power
6 years, 5 months ago (2014-07-08 20:11:16 UTC) #61
Message was sent while issue was closed.
Change committed as 281807

Powered by Google App Engine
This is Rietveld 408576698