From a452660d92925f004e30c194c0fcdb062246a11a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 29 Nov 2016 16:34:56 +0000 Subject: [PATCH] Revert "init: Reworked how we wait for COLDBOOT_DONE" This reverts commit d36115ef2f5c671e665a176f09c9d810df58bf89. Change-Id: I599b0eeebf9c062852323f2a4a986b18dd85288a --- init/init.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/init/init.cpp b/init/init.cpp index 3f5e7310b..734f1293e 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -163,28 +163,14 @@ static int wait_for_coldboot_done_action(const std::vector& args) { Timer t; LOG(VERBOSE) << "Waiting for " COLDBOOT_DONE "..."; - - // History: // Any longer than 1s is an unreasonable length of time to delay booting. // If you're hitting this timeout, check that you didn't make your // sepolicy regular expressions too expensive (http://b/19899875). - // Update: - // It is bad to allow device to randomly fail to boot. So, we should - // instead log an error and abandon boot process if we have waited - // for a *considerably* long period of time. For attempts that do not - // exceed the treshold, we keep a record of how long it took for further - // optimization work. - // Also, a longer wait period before timeout gives slower builds like - // heavily instrumented debug builds (e.g. KASan) a chance to fully boot. - if (wait_for_file(COLDBOOT_DONE, 45s) < 0) { - LOG(ERROR) << "Timed out waiting for " COLDBOOT_DONE "; rebooting into recovery mode..."; - android_reboot(ANDROID_RB_RESTART2, 0, "recovery"); - while (true) { pause(); } // in case reboot is denied + if (wait_for_file(COLDBOOT_DONE, 1s)) { + LOG(ERROR) << "Timed out waiting for " COLDBOOT_DONE; } - double duration = t.duration(); - property_set("ro.bootstats.cold_boot_duration", StringPrintf("%fs", duration).c_str()); - LOG(VERBOSE) << "Waiting for " COLDBOOT_DONE " took " << duration << "s."; + LOG(VERBOSE) << "Waiting for " COLDBOOT_DONE " took " << t.duration() << "s."; return 0; }