diff options
author | siggi <siggi@chromium.org> | 2014-12-05 07:44:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-05 15:44:46 +0000 |
commit | 5ed6480ab0d5c1cca5fd75b0682f15f33f32977c (patch) | |
tree | 25b8a974b8e1497967c73252fac18407099a077e /chrome | |
parent | 14ef64e8d0bfbf89cde4b0a9d265785370ab4806 (diff) | |
download | chromium_src-5ed6480ab0d5c1cca5fd75b0682f15f33f32977c.zip chromium_src-5ed6480ab0d5c1cca5fd75b0682f15f33f32977c.tar.gz chromium_src-5ed6480ab0d5c1cca5fd75b0682f15f33f32977c.tar.bz2 |
Remove the WindowsLogoffRace experiment.
Unfortunately these are not the droids we're looking for.
BUG=388741
Review URL: https://codereview.chromium.org/783533002
Cr-Commit-Position: refs/heads/master@{#307026}
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 27 | ||||
-rw-r--r-- | chrome/browser/lifetime/application_lifetime.cc | 35 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_browsertest.cc | 63 |
3 files changed, 7 insertions, 118 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 34ddec2..deb6202 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -446,25 +446,9 @@ bool RundownTaskCounter::TimedWait(const base::TimeDelta& max_time) { return waitable_event_.TimedWait(max_time); } -bool ExperimentUseBrokenSynchronization() { - // The logoff behavior used to have a race, whereby it would perform profile - // IO writes on the blocking thread pool, but would sycnhronize to the FILE - // thread. Windows feels free to terminate any process that's hidden or - // destroyed all it's windows, and sometimes Chrome would be terminated - // with pending profile IO due to this mis-synchronization. - // Under the "WindowsLogoffRace" experiment group, the broken behavior is - // emulated, in order to allow measuring what fraction of unclean shutdowns - // are due to this bug. - const std::string group_name = - base::FieldTrialList::FindFullName("WindowsLogoffRace"); - return group_name == "BrokenSynchronization"; -} - } // namespace void BrowserProcessImpl::EndSession() { - bool use_broken_synchronization = ExperimentUseBrokenSynchronization(); - // Mark all the profiles as clean. ProfileManager* pm = profile_manager(); std::vector<Profile*> profiles(pm->GetLoadedProfiles()); @@ -473,8 +457,7 @@ void BrowserProcessImpl::EndSession() { Profile* profile = profiles[i]; profile->SetExitType(Profile::EXIT_SESSION_ENDED); - if (!use_broken_synchronization) - rundown_counter->Post(profile->GetIOTaskRunner().get()); + rundown_counter->Post(profile->GetIOTaskRunner().get()); } // Tell the metrics service it was cleanly shutdown. @@ -487,8 +470,7 @@ void BrowserProcessImpl::EndSession() { // commit metrics::prefs::kStabilitySessionEndCompleted change immediately. local_state()->CommitPendingWrite(); - if (!use_broken_synchronization) - rundown_counter->Post(local_state_task_runner_.get()); + rundown_counter->Post(local_state_task_runner_.get()); #endif } @@ -502,11 +484,6 @@ void BrowserProcessImpl::EndSession() { // If you change the condition here, be sure to also change // ProfileBrowserTests to match. #if defined(USE_X11) || defined(OS_WIN) - if (use_broken_synchronization) { - rundown_counter->Post( - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get()); - } - // Do a best-effort wait on the successful countdown of rundown tasks. Note // that if we don't complete "quickly enough", Windows will terminate our // process. diff --git a/chrome/browser/lifetime/application_lifetime.cc b/chrome/browser/lifetime/application_lifetime.cc index 5f57bd6..ddac004 100644 --- a/chrome/browser/lifetime/application_lifetime.cc +++ b/chrome/browser/lifetime/application_lifetime.cc @@ -11,7 +11,6 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" -#include "base/metrics/field_trial.h" #include "base/prefs/pref_service.h" #include "base/process/kill.h" #include "base/process/process_handle.h" @@ -251,16 +250,6 @@ void ExitCleanly() { } #endif -namespace { - -bool ExperimentUseBrokenSynchronization() { - const std::string group_name = - base::FieldTrialList::FindFullName("WindowsLogoffRace"); - return group_name == "BrokenSynchronization"; -} - -} // namespace - void SessionEnding() { // This is a time-limited shutdown where we need to write as much to // disk as we can as soon as we can, and where we must kill the @@ -294,25 +283,11 @@ void SessionEnding() { base::win::SetShouldCrashOnProcessDetach(false); #endif - if (ExperimentUseBrokenSynchronization()) { - CloseAllBrowsers(); - - // Send out notification. This is used during testing so that the test - // harness can properly shutdown before we exit. - content::NotificationService::current()->Notify( - chrome::NOTIFICATION_SESSION_END, - content::NotificationService::AllSources(), - content::NotificationService::NoDetails()); - - // This will end by terminating the process. - content::ImmediateShutdownAndExitProcess(); - } else { - // On Windows 7 and later, the system will consider the process ripe for - // termination as soon as it hides or destroys its windows. Since any - // execution past that point will be non-deterministically cut short, we - // might as well put ourselves out of that misery deterministically. - base::KillProcess(base::GetCurrentProcessHandle(), 0, false); - } + // On Windows 7 and later, the system will consider the process ripe for + // termination as soon as it hides or destroys its windows. Since any + // execution past that point will be non-deterministically cut short, we + // might as well put ourselves out of that misery deterministically. + base::KillProcess(base::GetCurrentProcessHandle(), 0, false); } void IncrementKeepAliveCount() { diff --git a/chrome/browser/profiles/profile_browsertest.cc b/chrome/browser/profiles/profile_browsertest.cc index e5eeffd..5a43b75 100644 --- a/chrome/browser/profiles/profile_browsertest.cc +++ b/chrome/browser/profiles/profile_browsertest.cc @@ -8,7 +8,6 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/json/json_reader.h" -#include "base/metrics/field_trial.h" #include "base/prefs/pref_service.h" #include "base/sequenced_task_runner.h" #include "base/synchronization/waitable_event.h" @@ -398,66 +397,4 @@ IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, ASSERT_TRUE(succeeded) << "profile->EndSession() timed out too often."; } -IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, - EndSessionBrokenSynchronizationExperiment) { - base::ScopedTempDir temp_dir; - ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); - - // Select into the field trial group. - base::FieldTrialList::CreateFieldTrial("WindowsLogoffRace", - "BrokenSynchronization"); - - ProfileManager* profile_manager = g_browser_process->profile_manager(); - ASSERT_TRUE(profile_manager); - std::vector<Profile*> loaded_profiles = profile_manager->GetLoadedProfiles(); - - ASSERT_NE(loaded_profiles.size(), 0UL); - Profile* profile = loaded_profiles[0]; - - bool mis_wrote = false; - // This retry loop reduces flakiness due to the fact that this ultimately - // tests whether or not a code path hits a timed wait. - for (size_t retries = 0; retries < 3; ++retries) { - // Flush the profile data to disk for all loaded profiles. - profile->SetExitType(Profile::EXIT_CRASHED); - FlushTaskRunner(profile->GetIOTaskRunner().get()); - - // Make sure that the prefs file was written with the expected key/value. - ASSERT_EQ(GetExitTypePreferenceFromDisk(profile), "Crashed"); - - base::WaitableEvent is_blocked(false, false); - base::WaitableEvent* unblock = new base::WaitableEvent(false, false); - - // Block the profile's IO thread. - profile->GetIOTaskRunner()->PostTask(FROM_HERE, - base::Bind(&BlockThread, &is_blocked, base::Owned(unblock))); - // Wait for the IO thread to actually be blocked. - is_blocked.Wait(); - - // The blocking wait in EndSession has a timeout, so a non-write can only be - // concluded if it happens in less time than the timeout. - base::Time start = base::Time::Now(); - - // With the broken synchronization this is expected to return without - // blocking for the Profile's IO thread. - g_browser_process->EndSession(); - - base::Time end = base::Time::Now(); - - // The EndSession timeout is 10 seconds, we take a 5 second run-through as - // sufficient proof that we didn't hit the timed wait. - if (end - start < base::TimeDelta::FromSeconds(5)) { - // Make sure that the prefs file is unmodified with the expected - // key/value. - EXPECT_EQ(GetExitTypePreferenceFromDisk(profile), "Crashed"); - mis_wrote = true; - } - - // Release the IO thread thread. - unblock->Signal(); - } - - ASSERT_TRUE(mis_wrote); -} - #endif // defined(USE_X11) || defined(OS_WIN) |