OSDN Git Service

Start Watchdog early during boot
authorZimuzo <zezeozue@google.com>
Tue, 16 Apr 2019 12:33:01 +0000 (13:33 +0100)
committerZimuzo <zezeozue@google.com>
Thu, 25 Apr 2019 17:39:12 +0000 (18:39 +0100)
commitb065b15a901a0a9d9b90e26e593f2b193d90be25
treed58487d209421f179932843c6bf4d64590a99c44
parent22f79f250ca06385340bb7be2e7a274538d399e5
Start Watchdog early during boot

The system server can deadlock without making progress during early
boot. If this happens without crashing, no rollback mechanisms will be
triggered because there's no crash. With this change, if the system
server deadlocks early during boot, the Watchdog will crash the
system server, frequent enough crashes (4 in 4 mins) will trigger
the native watchdog and cause apexd to rollback any staged mainline updates.

Bug: 129597207
Test: Boots fine and logs indicate threads and monitors are registered
properly. Also adding an artificial sleep to the PackageManagerService
during boot crashes the system_server. At the moment, this is not
detected by the native watchdog because the default_timeout of 60
seconds before crashing the system_server never triggers the native
watchdog crash frequency threshold. Will fix in later cl.

Change-Id: I956a263e96d17d55bc512a5eab905cd2a14a7abb
services/core/java/com/android/server/Watchdog.java
services/java/com/android/server/SystemServer.java