OSDN Git Service

ART: Decrease dex2oat watchdog timeout
authorAndreas Gampe <agampe@google.com>
Mon, 14 Sep 2015 22:34:38 +0000 (15:34 -0700)
committerAndreas Gampe <agampe@google.com>
Fri, 18 Sep 2015 02:45:35 +0000 (19:45 -0700)
Keep the dex2oat watchdog timeout lower than the package manager
timeout, so that dex2oat kills itself before the system server
watchdog kills the system because of the long installation.

Bug: 23629410
Change-Id: I5faa23a1715736a1c2ba3f302a6ee41130d3fbae

dex2oat/dex2oat.cc

index 8cbca0b..b308b51 100644 (file)
@@ -435,8 +435,10 @@ class WatchDog {
   // Debug builds are slower so they have larger timeouts.
   static constexpr int64_t kSlowdownFactor = kIsDebugBuild ? 5U : 1U;
 
-  // 10 minutes scaled by kSlowdownFactor.
-  static constexpr int64_t kWatchDogTimeoutSeconds = kSlowdownFactor * 10 * 60;
+  // 9.5 minutes scaled by kSlowdownFactor. This is slightly smaller than the Package Manager
+  // watchdog (PackageManagerService.WATCHDOG_TIMEOUT, 10 minutes), so that dex2oat will abort
+  // itself before that watchdog would take down the system server.
+  static constexpr int64_t kWatchDogTimeoutSeconds = kSlowdownFactor * (9 * 60 + 30);
 
   bool is_watch_dog_enabled_;
   bool shutting_down_;