OSDN Git Service

Support different watchdog timeouts for different entities
authorChristopher Tate <ctate@google.com>
Thu, 24 Oct 2013 00:28:27 +0000 (17:28 -0700)
committerChristopher Tate <ctate@google.com>
Thu, 24 Oct 2013 17:46:28 +0000 (10:46 -0700)
commite6f81cf1f69e0683f969238f921950befba8e6c3
treed845ebcc18cc2e941e33c47b0e37a0ad116cb58f
parentd9e98a4b6d3181ab3d58b7781ee2f88a389ecf1f
Support different watchdog timeouts for different entities

We need to be able to perform very lengthy operations on some threads
(e.g. the I/O thread responsible for installing multi-gigabyte APKs) but
still have long-run deadlock/hang detection applied to those threads.
Previously the watchdog mechanism applied the same policy to all
monitored threads: unresponsive after 60 seconds => restart the system.

Now, each monitored entity can have its own independent timeout after
which the watchdog declares deadlock and restarts the runtime.  The
halfway-finished intermediate thread stacks are dumped based on the
specific entity's declared timeout, not the global 30 second checking
interval.

With that new mechanism in place, the Package Manager's lengthy-I/O
thread watchdog timeout is raised to 10 minutes.

Bug 11278188

Change-Id: I512599260009c31416b2385f778681e5b9597f05
services/java/com/android/server/Watchdog.java
services/java/com/android/server/pm/PackageManagerService.java